package com.cwt_taxi_xa.protocol;

import android.content.Context;
import android.content.Intent;
import android.util.Log;
import android.widget.Toast;

import com.cwt_taxi_xa.ContactActivity;
import com.cwt_taxi_xa.EventActivity;
import com.cwt_taxi_xa.EventList;
import com.cwt_taxi_xa.MainApplication;
import com.cwt_taxi_xa.QuestionActivity;
import com.cwt_taxi_xa.QuestionList;
import com.cwt_taxi_xa.constants.Constants;
import com.cwt_taxi_xa.constants.ConstantsAram;
import com.cwt_taxi_xa.constants.MyStatus;
import com.cwt_taxi_xa.constants.SPConstants;
import com.cwt_taxi_xa.data.DataUtil;
import com.cwt_taxi_xa.db.bll.CarCallSystemBiz;
import com.cwt_taxi_xa.db.bll.ContactBiz;
import com.cwt_taxi_xa.db.bll.EventBiz;
import com.cwt_taxi_xa.db.bll.LocalInfoBiz;
import com.cwt_taxi_xa.db.bll.MessageBiz;
import com.cwt_taxi_xa.db.bll.QuestionBiz;
import com.cwt_taxi_xa.model.AaData;
import com.cwt_taxi_xa.model.ContactInfo;
import com.cwt_taxi_xa.model.EventInfo;
import com.cwt_taxi_xa.model.LocalInfo;
import com.cwt_taxi_xa.model.MessageCenter;
import com.cwt_taxi_xa.model.QuestionInfo;
import com.cwt_taxi_xa.model.RecorderInfo;
import com.cwt_taxi_xa.protocol.config.PhotographTask;
import com.cwt_taxi_xa.protocol.voice.ResponseState;
import com.cwt_taxi_xa.receiver.KeyBroadcast;
import com.cwt_taxi_xa.record.RecordTimer;
import com.cwt_taxi_xa.record.RecorderBiz;
import com.cwt_taxi_xa.record.RecorderListUploadManager;
import com.cwt_taxi_xa.record.RecorderUploadManager;
import com.cwt_taxi_xa.service.FloatService;
import com.cwt_taxi_xa.service.SerialPortService;
import com.cwt_taxi_xa.timer.TimerHeartBeat;
import com.cwt_taxi_xa.util.AppLog;
import com.cwt_taxi_xa.util.AudioUtil;
import com.cwt_taxi_xa.util.ExceptionUtil;
import com.cwt_taxi_xa.util.PhoneApp;
import com.cwt_taxi_xa.util.SPUtils;
import com.cwt_taxi_xa.util.StringUtil;
import com.cwt_taxi_xa.util.TTsFunction;
import com.cwt_taxi_xa.util.ToastUtils;
import com.cwt_taxi_xa.util.Tools;
import com.cwt_taxi_xa.util.VolumeControl;

import java.util.ArrayList;
import java.util.Iterator;
import java.util.Map;
import java.util.regex.Matcher;
import java.util.regex.Pattern;

/**
 * 奇华中心与APP通信处理类
 *
 * @author wlh
 */
public class BusinessProcessSZ {

	private static final String TAG = "BusinessProcessQH";

	public static PhotographTask photographTask = new PhotographTask();

	@SuppressWarnings({ "rawtypes", "unchecked" })
	public static void process(AaData aaData, final Context context) {

		int msgId = aaData.getMid();
		ArrayList<Object> dataList = aaData.getDataList();
		ArrayList<Object> itemsList = aaData.getItemsList();
		switch (msgId) {
			case 0x8001: // 3.2.2 中心通用应答
				doAnswer(dataList, context);
				break;

			case 0x8103: // 10.3.5.4 设置参数
				try {
					Map<String, Object> paramMap = (Map<String, Object>) dataList
							.get(0);
					// 迭代MAP值
					Iterator iter = paramMap.entrySet().iterator();
					while (iter.hasNext()) {
						Map.Entry entry = (Map.Entry) iter.next();
						Object key = entry.getKey();
						Object val = entry.getValue();
						// 参数ID
						int paramId = Integer.parseInt(String.valueOf(key), 16);
						String paramHexValue = String.valueOf(val);
						setPreferences(paramId, paramHexValue);
					}

				} catch (Exception e) {

					AppLog.e(ExceptionUtil.getInfo(e));
					e.printStackTrace();
				}
				//参数设置完成
				MeterDecoder.meterConfigTask.queryRateParam();
				DispatchCenterUsers.socketManager.startConfig();
				break;

			case 0x8104: // 3.2.7 查询终端参数
			case 0x8F18: // 3.2.7 查询终端参数
			case 0x8F19: // 3.2.7 查询终端参数
				try {
					/** 字节数据总长度 */
					int paramsDataLength = 0;
					/** 要查询参数的个数 */
					int[] paramsIds = (int[]) dataList.get(0);
					/** 将查询到的参数的字节数据放进Object[] */
					Object[] obj = new Object[paramsIds.length];
					for (int i = 0; i < paramsIds.length; i++) {
						byte[] singleParams = getPreference(paramsIds[i]);
						if (singleParams != null) {
							obj[i] = singleParams;
							paramsDataLength += singleParams.length;
						}
					}

					/** 封装参数字节数据 */
					byte[] data = new byte[paramsDataLength];
					int dstPos = 0;
					for (int i = 0; i < obj.length; i++) {
						byte[] singleParams = (byte[]) obj[i];
						if (singleParams != null) {
							System.arraycopy(singleParams, 0, data, dstPos,
									singleParams.length);
							dstPos += singleParams.length;
						}
					}
					DispatchCenterUsers.witeMsg(
							Encoder.getQueryTerminalParams(aaData.getSeq(), data),
							0);
				} catch (Exception e) {
					AppLog.e(ExceptionUtil.getInfo(e));
					e.printStackTrace();
				}
				break;

			case 0x8105: // 3.2.9 终端控制
				try {
					int num = 0;
					// 命令字
					int cmdWord = (Integer) dataList.get(num++);
					switch (cmdWord) {
//				case 1:
//					/** 无线升级 */
//					/** 命令参数 */
//					// 设备类型
//					int deviceType = (Integer) dataList.get(num++);
//					// 厂商标识
//					int csbs = (Integer) dataList.get(num++);
//					// 硬件版本号
//					String hwVersionCode = (String) dataList.get(num++);
//					// 软件版本号
//					String swVersionCode = (String) dataList.get(num++);
//					// APN
//					String apn = (String) dataList.get(num++);
//					// 拨号用户名
//					String userName = (String) dataList.get(num++);
//					// 拨号密码
//					String password = (String) dataList.get(num++);
//					// 升级服务器地址
//					String ip = (String) dataList.get(num++);
//					// 升级服务器端口
//					String port = (String) dataList.get(num++);
//					break;
						case 2://关机
							AppLog.e("关机");
							try {
								Intent intent = new Intent(
										"android.intent.action.ACTION_REQUEST_SHUTDOWN");
								intent.putExtra("android.intent.extra.KEY_CONFIRM", false);
								// 其中false换成true,会弹出是否关机的确认窗口
								intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
								MainApplication.topActivity.startActivity(intent);

							} catch (Exception ex) {
								ex.printStackTrace();
							}
							break;
						case 3://复位
							AppLog.e("复位");
							try {
								Intent intent = new Intent(
										"android.intent.action.ACTION_REQUEST_SHUTDOWN");
								intent.putExtra("android.intent.extra.KEY_CONFIRM", false);
								// 其中false换成true,会弹出是否关机的确认窗口
								intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
								MainApplication.topActivity.startActivity(intent);

							} catch (Exception ex) {
								ex.printStackTrace();
							}
							break;
						case 4://恢复出厂
							AppLog.e("恢复出厂");
							DataUtil.saveJJQ(0);
							DeviceBiz.setDeviceCode(SPConstants.SPV_clientcode);
							DeviceBiz.setCarNumber(SPConstants.SPV_carcode);
							DeviceBiz.setIp(SPConstants.SPV_ip);
							DeviceBiz.setIpBak(SPConstants.SPV_ip);
							DeviceBiz.setPort(SPConstants.SPV_PORT);
							DeviceBiz.setPortBak(SPConstants.SPV_PORT);
							DeviceBiz.setSwitcher(1);
							DeviceBiz.setSwitcherBak(1);
							Toast.makeText(MainApplication.getInstance(), "恢复出厂成功！", 1000).show();
							break;
						case 5://关闭数据通信
							AppLog.e("关闭数据通信");
							break;
						case 6://关闭无线信号
							AppLog.e("关闭无线信号");
							break;
						default:
							break;
					}
				} catch (Exception e) {
					AppLog.e(ExceptionUtil.getInfo(e));
					e.printStackTrace();
				}
				break;

			case 0x8b04: // 3.2.13 报警确认/接触报警
				try {
					// 上级已处理业务
				} catch (Exception e) {
					AppLog.e(ExceptionUtil.getInfo(e));
					e.printStackTrace();
				}
				break;

			case 0x8201: // 3.2.14 位置信息查询
				try {
					// 向服务器发送位置信息
					DispatchCenterUsers.witeMsg(
							Encoder.getLocationInformationAnswer(aaData.getSeq()),
							0);
				} catch (Exception e) {
					AppLog.e(ExceptionUtil.getInfo(e));
					e.printStackTrace();
				}
				break;

			case 0x8202: // 10.3.5.12位置跟踪控制
				try {
					int num = 0;
					String type = (String) dataList.get(num++);
					// 时间/距离间隔 UINT16 时间单位为秒(s) 距离间隔为米
					final int interval = (Integer) dataList.get(num++);
					// 持续时间/距离 UINT32 时间单位为秒(s) 距离间隔为米
					final int length = (Integer) dataList.get(num++);
					Log.e("位置追踪控制", type + "===" + interval + "===" + length);
					/**
					 * 13 跟踪方式 UINT8 0X00:按时间间隔、持续时间； 0X11:按距离间隔、持续距离；
					 * 0X01:按时间间隔、持续距离； 0X10:按距离间隔、持续时间； 0XFF:停止当前跟踪
					 */

					if (type.equals("00")) {
						// 监控次数
						TimerHeartBeat.gap = interval;
						TimerHeartBeat.times = length / interval;
						//TimerHeartBeat.setTimes(length / interval);

						// DispatchCenterUsers.startTimingTrack(interval, timer);
					} else if (type.equals("FF")) {
						TimerHeartBeat.times = 0;
						// DispatchCenterUsers.stopTimingTrack();
					}

				} catch (Exception e) {
					AppLog.e(ExceptionUtil.getInfo(e));
					e.printStackTrace();
				}
				break;

			case 0x8300: // 3.2.24 文本信息下发
				try {
					if(dataList.size()>0){
						int num = 0;
						// 标志
						int bz = (Integer) dataList.get(num++);
						// 文本信息
						String content	 = (String) dataList.get(num++);
						/**
						 * 标志
						 *	位		标志
						 *	0	1：紧急
						 *	1	预留
						 *	2	1：终端显示器显示
						 *	3	1：终端语音合成播读
						 *	4	1：广告屏显示
						 *西安交委锐明平台   5-6位
						 *从高往低
						 *00普通
						 *01 行业
						 *10 公共
						 *11 个人
						 *	5～7	预留
						 */
						String aa = StringUtil.getAntitone(Tools.byteTobit(Tools.int2Bytes(bz, 1)));
						// 紧急标识
						int alarmFlag = Integer.parseInt(String.valueOf(aa.charAt(0)));
						// 显示装置
						int showFlag = Integer.parseInt(String.valueOf(aa.charAt(2)));
						// TTS
						int ttsFlag = Integer.parseInt(String.valueOf(aa.charAt(3)));
						// 广告屏显示
						int topLightPresetInfoBz = Integer.parseInt(String.valueOf(aa.charAt(4)));
						// 锐明私有
						int rm1 = Integer.parseInt(String.valueOf(aa.charAt(6)));
						// 锐明私有
						int rm2 = Integer.parseInt(String.valueOf(aa.charAt(5)));

						if(presetTts(ttsFlag,content)){
							return;
						}

						if(rm1==0&&rm2==0){
							content = "[普通信息]"+content;
						}
						else if(rm1==0&&rm2==1){
							content = "[行业信息]"+content;
						}
						else if(rm1==1&&rm2==0){
							content = "[公共信息]"+content;
						}
						else if(rm1==1&&rm2==1){
							content = "[个人信息]"+content;
						}

						// 终端消息
						//数据库中插入消息
						MessageCenter m = new MessageCenter();
						if(alarmFlag == 1){
							m.setContent("[紧急]"+content);
						}else{
							m.setContent(content);
						}
						new MessageBiz(context).insertMessageCenter(m);
						//					if(Constants.DISPATCH_INFO){
						m.setIsread(1);
						//						content = CdSDK.decode(content);
						if(ttsFlag == 1){
							//TTS阅读
							if(alarmFlag == 1){
								TTsFunction.speakText("收到紧急消息,"+content);
							}else{
								TTsFunction.speakText("收到广播消息,"+content);
							}
						}else{
							//普通消息提示音
							VolumeControl.playSound();
						}
						if(showFlag == 1){
							//跳转到调度页面
						/*Intent intent = new Intent();
							intent.setClass(context, MessageActivity.class);
							intent.putExtra("message", content);
							intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
							context.startActivity(intent);*/
							if(alarmFlag == 1){
								ToastUtils.showToastForMessage("（紧急）"+content);
							}else{
								ToastUtils.showToastForMessage(content);
							}
						}
						//					}else{
						//						VolumeControl.playSound();
						//					}
					}
				} catch (Exception e) {
					AppLog.e(ExceptionUtil.getInfo(e));
					e.printStackTrace();
				}
				break;

			case 0x8301: // 3.2.25 事件设置
				try {
					int num = 0;
					// 事件项个数	UINT8	0：删除ISU现有所有事件
					int count = (Integer) dataList.get(num++);
					EventBiz eventBiz = new EventBiz(context);
					ArrayList<EventInfo> infos = null;
					if(count == 0){
						eventBiz.clearEvents();
					}else{
						infos = (ArrayList<EventInfo>) dataList.get(num);
						eventBiz.updateEvents(infos);
						if(infos != null){
							//普通消息提示音
							VolumeControl.playSound();
							if(infos.size() == 1){
								TTsFunction.speakText("收到事件信息,"+infos.get(0).getText());
								Intent intent = new Intent(MainApplication.getInstance(), EventActivity.class);
								intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
								intent.putExtra("info", infos.get(0));
								MainApplication.getInstance().startActivity(intent);
							}
						}
					}
				} catch (Exception e) {
					AppLog.e(ExceptionUtil.getInfo(e));
					e.printStackTrace();
				}
				break;

			case 0x8302: // 3.2.27 提问下发
				try {
					int num = 0;
					QuestionInfo info = (QuestionInfo) dataList.get(num);
					QuestionBiz biz = new QuestionBiz(context);
					biz.addQuestion(info);
					/**
					 * 位	标志
					 * 0	1：紧急
					 * 1	预留
					 * 2	预留
					 * 3	1：语音合成（TTS）播读
					 * 4	1：广告屏显示
					 * 5～7	预留
					 * */
					String aa = info.getFlag();
					// 紧急标识
					int alarmFlag = Integer.parseInt(String.valueOf(aa.charAt(0)));
					// TTS
					int ttsFlag = Integer.parseInt(String.valueOf(aa.charAt(3)));
					int show = Integer.parseInt(String.valueOf(aa.charAt(4)));

//				if(ttsFlag == 1){
//					//TTS阅读
//					if(alarmFlag == 1){
//						TTsFunction.speakText("收到紧急提问信息,"+info.getText());
//					}else{
					TTsFunction.speakText("收到提问信息,"+info.getText());
//					}
//				}else{
//					//普通消息提示音
//					VolumeControl.playSound();
//				}

//				if(show == 1){
					Intent intent = new Intent(MainApplication.getInstance(), QuestionActivity.class);
					intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
					intent.putExtra("info", info);
					MainApplication.getInstance().startActivity(intent);
//				}


				} catch (Exception e) {
					AppLog.e(ExceptionUtil.getInfo(e));
					e.printStackTrace();
				}
				break;

			case 0x8305: // 3.2.29 文本信息查询 (查询只支持后顶灯)
				try {
					// 标志
					// int flag = (Integer) dataList.get(0);
					// TTConstants.queryInfoFlag = flag;
					// String aa =
					// StringUtil.getAntitone(Tools.byteTobit(Tools.int2Bytes(flag,
					// 1)));
					// Thread thread = new Thread(){
					// @Override
					// public void run() {
					// // TODO Auto-generated method stub
					// super.run();
					// for(int i = 1;i<21;i++){
					// SendDateToSerial.witeSerialInfo("文本信息查询	(查询只支持后顶灯)"ncoderSZ55aa.queryPresetInfo(i));
					// try {
					// Thread.sleep(500);
					// } catch (InterruptedException e) {
					// // TODO Auto-generated catch block
					// e.printStackTrace();
					// }
					// }
					// }
					// };
					// thread.start();
				} catch (Exception e) {
					AppLog.e(ExceptionUtil.getInfo(e));
					e.printStackTrace();
				}
				break;

			case 0x8400: // 3.2.31 电话回拨
				try {
					int num = 0;
					// 标志
					int bz = (Integer) dataList.get(num++);
					// 语音通道 0：GSM 1：VOIP
					//int channel = (Integer) dataList.get(num++);
					// 电话号码
					String number = (String) dataList.get(num++);
					if(bz == 0){ // 0：普通通话
						AppLog.i( "电话回拨，类型：普通通话");
						PhoneApp.call(context, number);
					}else{ //1： 监听
						AppLog.i( "电话回拨，类型：监听");
						PhoneApp.callInMonitorType(context, number);
					}
					AppLog.i( "电话回拨，号码："+number);
				} catch (Exception e) {
					AppLog.e(ExceptionUtil.getInfo(e));
					e.printStackTrace();
				}
				break;

			case 0x8401: // 3.2.32 设置电话本
				try {
					int num = 0;
					ContactBiz contactBiz = new ContactBiz(context);
					// 联系人总数	UINT8	本条消息中联系人总数，0表示删除ISU上所有存储的联系人
					int count = (Integer) dataList.get(num++);
					//联系人项
					ArrayList<ContactInfo> contacts = null;
					if(count == 0){
						contactBiz.clearContacts();
						if(ContactActivity.activityExist){
							ContactActivity.handler.obtainMessage(1004).sendToTarget();
						}
					}else{
						contacts = (ArrayList<ContactInfo>) dataList.get(num);
						contactBiz.updateContacts(contacts);
						//普通消息提示音
						VolumeControl.playSound();
						// 更新电话本界面
						if(ContactActivity.activityExist){
							ContactActivity.handler.obtainMessage(1004).sendToTarget();
						}else{
							Intent intent3 = new Intent(MainApplication.getInstance(), ContactActivity.class);
							intent3.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
							MainApplication.getInstance().startActivity(intent3);
						}
					}

				} catch (Exception e) {
					AppLog.e(ExceptionUtil.getInfo(e));
					e.printStackTrace();
				}
				break;

			case 0x8500: // 3.2.33 车辆控制
				try {
					// int num = 0;
					// // 控制项
					// int item = (Integer) dataList.get(num++);
					// // 控制项
					// int mid = (Integer) dataList.get(num++);
					// if(item == 4){
					// if(mid == 0){
					// // 恢复计价器
					// ConstantsMeterState.setStateValue(8, "0");
					// byte[] stateByte = ConstantsMeterState.getStateByte();
					// SendDateToSerial.witeSerial("车辆控制-恢复计价器"ncoderSZ55aa.centraOrder(stateByte));
					// }else if(mid == 1){
					// // 锁定计价器
					// ConstantsMeterState.setStateValue(8, "1");
					// byte[] stateByte = ConstantsMeterState.getStateByte();
					// SendDateToSerial.witeSerial("车辆控制-锁定计价器"ncoderSZ55aa.centraOrder(stateByte));
					// }
					// }
					// DispatchCenterUsers.witeMsg(Encoder.vehicleControlAnswer(aaData.getSeq()),
					// 0);
				} catch (Exception e) {
					AppLog.e(ExceptionUtil.getInfo(e));
					e.printStackTrace();
				}
				break;

			/*
			 * case 0x8600: //3.2.18 设置圆形区域 try { int num = 0; // 设置属性 BYTE
			 * 0：更新区域；1：追加区域； 2：修改区域 int type = (Integer) dataList.get(num++);
			 * ArrayList<AreaFence> fences = (ArrayList<AreaFence>)
			 * dataList.get(num); FenceBiz biz = new FenceBiz(context); switch
			 * (type) { case 0: case 2: biz.update(fences); break; case 1:
			 * biz.save(fences); break; default: break; } biz.setFence(); } catch
			 * (Exception e) { AppLog.e(ExceptionUtil.getInfo(e));
			 * e.printStackTrace(); } break;
			 *
			 * case 0x8601: //3.2.19 删除圆形区域 try { int num = 0; int[] fenceIds =
			 * (int[]) dataList.get(num++); FenceBiz biz = new FenceBiz(context);
			 * biz.deleteByAreaId(fenceIds); biz.setFence(); } catch (Exception e) {
			 * AppLog.e(ExceptionUtil.getInfo(e)); e.printStackTrace(); } break;
			 *
			 * case 0x8602: //3.2.20 设置矩形区域 try { int num = 0; // 设置属性 BYTE
			 * 0：更新区域；1：追加区域； 2：修改区域 int type = (Integer) dataList.get(num++);
			 * ArrayList<AreaFence> fences = (ArrayList<AreaFence>)
			 * dataList.get(num); FenceBiz biz = new FenceBiz(context); switch
			 * (type) { case 0: case 2: biz.update(fences); break; case 1:
			 * biz.save(fences); break; default: break; } biz.setFence(); } catch
			 * (Exception e) { AppLog.e(ExceptionUtil.getInfo(e));
			 * e.printStackTrace(); } break;
			 *
			 * case 0x8603: //3.2.21 删除矩形区域 try { int num = 0; int[] fenceIds =
			 * (int[]) dataList.get(num++); FenceBiz biz = new FenceBiz(context);
			 * biz.deleteByAreaId(fenceIds); biz.setFence(); } catch (Exception e) {
			 * AppLog.e(ExceptionUtil.getInfo(e)); e.printStackTrace(); } break;
			 */

			/*
			 * case 0x8800: //3.2.37 多媒体数据上传应答 try { // 多媒体ID DWORD int num = 0; int
			 * mediaId = (Integer) dataList.get(num++); // 重传包总数 UINT8 int count =
			 * (Integer) dataList.get(num++); // 重传包ID列表 DWORD[] if(count != 0){
			 * int[] id = (int[]) dataList.get(num++);
			 * UploadManager.reload(""+mediaId, id); }else{
			 * UploadManager.doEnd(""+mediaId); }
			 *
			 * } catch (Exception e) { // TODO: handle exception
			 * AppLog.e(ExceptionUtil.getInfo(e)); e.printStackTrace(); } break;
			 */

			case 0x8801: // 3.2.38 摄像头立即拍摄命令
				try {
					int num = 0;
					// 通道ID UINT8 0:全部摄像头 1：标识对内摄像头 2：标识对外摄像头
					int channelId = (Integer) dataList.get(num++);

					// 拍摄命令 UINT16 0：停止拍摄 其他:拍摄张数
					int order = (Integer) dataList.get(num++);

					// 拍照间隔/录像时间 UINT16 秒 0表示最小
					int timeInterval = (Integer) dataList.get(num++);

					// 保存标志 UTNT8
					int saveFlag = (Integer) dataList.get(num++);

					// 分辨率 UINT8
					int resolution = (Integer) dataList.get(num++);

					// 图像/视频质量 UINT8
					int quality = (Integer) dataList.get(num++);

					// 亮度 UINT8
					int brightness = (Integer) dataList.get(num++);
					// 对比度 UINT8
					int contrast = (Integer) dataList.get(num++);
					// 饱和度 UINT8
					int saturability = (Integer) dataList.get(num++);
					// 色度 U1NT8
					int chroma = (Integer) dataList.get(num++);
					//流水号
					int seq = (int) dataList.get(num++);
					// 拍照
					AppLog.e("00000000000000》通道："+channelId+"   命令："+order+"   间隔："+timeInterval+"   保存标志："+saveFlag+"   分辨率："+resolution+"   质量："+quality);
					Intent intent = new Intent(FloatService.action_camera);
					intent.putExtra("type", 2);
					intent.putExtra("seq", seq);
					intent.putExtra("count", order);
					intent.putExtra("timeInterval", timeInterval);
					//0：320×240；1：640×480；2：800×600；其他保留
					switch (resolution) {
						case 0:
							intent.putExtra("w", 320);
							intent.putExtra("h", 240);
							break;
						case 1:
							intent.putExtra("w", 640);
							intent.putExtra("h", 480);
							break;
						case 2:
							intent.putExtra("w", 800);
							intent.putExtra("h", 600);
							break;
						default:
							intent.putExtra("w", 1280);
							intent.putExtra("h", 720);
							break;
					}
					intent.putExtra("channelId", channelId);
					MainApplication.topActivity.sendBroadcast(intent);
//				 PhotoInfo info = new PhotoInfo(3, saveFlag, channelId,
//				 resolution+1);
//				 info.setSerialId(""+aaData.getSeq());
//				 CameraManager.takeAPhoto(info);

				} catch (Exception e) {
					AppLog.e(ExceptionUtil.getInfo(e));
					e.printStackTrace();
				}
				break;

			case 0x8802: // 3.2.39 多媒体检索
				try {
					int num = 0;
					// 通道ID BYTE
					int channelId = (Integer) dataList.get(num++);
					// 拍照原因 UINT8
					int reason = (Integer) dataList.get(num++);
					// 起始时间 BCD[6]
					String sTime = (String) dataList.get(num++);
					// 结束时间 BCD[6]
					String eTime = (String) dataList.get(num++);

				} catch (Exception e) {
					AppLog.e(ExceptionUtil.getInfo(e));
					e.printStackTrace();
				}
				break;

			case 0x8B00: // 3.2.42 订单任务下发
				try {
					// AppLog.i(
					// "招标信息是否接收 true 接收 false 不接收=="+Constants.INVITE_BIDS_INFO);
					// if(Constants.INVITE_BIDS_INFO && dataList.size() > 0){
					// int num = 0;
					// // 业务ID BCD[6] 中心生成的业务ID
					// String orderId = (String) dataList.get(num++);
					// // 业务类型 UINT8 0:即时召车 1:预约召车 2:车辆指派
					// int orderType = (Integer) dataList.get(num++);
					// // 要车时间 BCD[6] YY-MM-DD-hh-mm-ss
					// String orderTime = (String) dataList.get(num++);
					// // 备注 STRING 其它要求
					// String remarks = (String) dataList.get(num++);
					//
					// Invitation invitation = new Invitation();
					// invitation.setOrderid(orderId);
					// invitation.setOrderType(orderType);
					// invitation.setOrderTime(DateUtil.dateTimeFormat(orderTime));
					// invitation.setRemark(remarks);
					// String message = InvitationBiz.getMessage(invitation);
					// invitation.setMessage(message);
					//
					// //往数据中插入招标信息
					// InvitationBiz biz = new InvitationBiz(context);
					// if(biz.getInvitationCount()>=100){
					// biz.deleteFirstInvitation();
					// }
					// biz.insertInvitation(invitation);
					//
					// //跳转到抢答页面
					// Intent intent = new Intent();
					// intent.setClass(context, Responder808.class);
					// intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
					// Bundle bundle = new Bundle();
					// bundle.putSerializable("invitation", invitation);
					// intent.putExtras(bundle);
					// context.startActivity(intent);
					// }
				} catch (Exception e) {
					AppLog.e(ExceptionUtil.getInfo(e));
					e.printStackTrace();
				}
				break;

			case 0x8b01: // 3.2.45 订单确认
				try {
					// int num = 0;
					// // 业务ID
					// final String orderId = (String) dataList.get(num++);
					// // 业务类型
					// int type = (Integer) dataList.get(num++);
					// // 要车时间 0表示不启用
					// String orderTime = (String) dataList.get(num++);
					// // 乘客位置经度 0表示不启用
					// int sLng = (Integer) dataList.get(num++);
					// // 乘客位置纬度 0表示不启用
					// int sLat = (Integer) dataList.get(num++);
					// // 目的地经度 0表示不启用
					// int eLng = (Integer) dataList.get(num++);
					// // 目的地纬度 0表示不启用
					// int eLat = (Integer) dataList.get(num++);
					// // 电召费 0表示无服务费
					// String fee = (String) dataList.get(num++);
					// // 乘客电话号码
					// String phone = (String) dataList.get(num++);
					// // 备注 STRING 其它要求
					// String remarks = (String) dataList.get(num++);
					//
					// if(SuccessFullBDList.instance != null){
					// SuccessFullBDList.instance.finish();
					// }
					//
					// //往数据中插入中标订单
					// SuccessBidderBiz sbBiz = new SuccessBidderBiz(context);
					// SuccessfullBidder sb = new SuccessfullBidder();
					// /**
					// * 判断乘客号码第一位是否为0，是截掉，否保留
					// */
					// if(phone.substring(0, 1).equals("0")){
					// phone = phone.substring(1,phone.length());
					// }
					// sb.setPassengerPhoneNum(phone);
					//
					// String lon = "0";
					// String lat = "0";
					// if(sLng != 0){
					// double dlng = sLng/60*1E-4;
					// lon = ""+dlng;
					// }
					//
					// if(sLat != 0){
					// double dlat = sLat/60*1E-4;
					// lat = ""+dlat;
					// }
					// sb.setIsdone(0);
					// sb.setIspush(0);
					// sb.setOrderid(orderId);
					// sb.setOrderType(type);
					// sb.setOrderTime(DateUtil.dateTimeFormat(orderTime));
					// sb.setRemark(remarks);
					// sb.setLon(lon);
					// sb.setLat(lat);
					// sb.setStarting(remarks);
					// sb.setMessage(SuccessBidderBiz.getMessage(sb));
					//
					// if(sbBiz.getSuccessFullCount(0)>=100){
					// sbBiz.deleteFirstSuccessfullBidder();
					// }
					//
					// final long id = sbBiz.insertSuccessfullBidder(sb);
					// //如果当前正在中标界面，则SUCCESSFUL_BIDS_INFO为false，但是如果此时收到中标信息
					// //要等这条信息处理完后接着播报。
					// if(Constants.SUCCESSFUL_BIDS_INFO){
					// // TODO Auto-generated method stub
					// //跳转到中标界面
					// Intent intent1 = new Intent();
					// intent1.setClass(context, SuccessFullBDDetails808.class);
					// intent1.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
					// intent1.putExtra("orderid", orderId);
					// intent1.putExtra("id", String.valueOf(id));
					// context.startActivity(intent1);
					//
					// //TTS阅读
					// TTsFunction.speakText("您的电召抢答成功");
					// }
					// /** 添加预约提醒*/
					// if(sb.getOrderType() ==
					// RadioCallConstants.ORDER_TYPE_ADVANCE){
					// SuccessfullBidder newSb =
					// sbBiz.getSuccessfulByorderId(orderId);
					// sbBiz.addAdvanceAlarm(newSb);
					// }
					//
					// TTUtil.sendText2TT(4);
				} catch (Exception e) {
					AppLog.e(ExceptionUtil.getInfo(e));
					e.printStackTrace();
				}
				break;

			case 0x8b09: // 3.2.47 订单取消
				// 业务ID
				try {
					// int num = 0;
					// // 业务ID
					// String orderId = (String) dataList.get(0);
					// SuccessBidderBiz sbBiz = new SuccessBidderBiz(context);
					// // sbBiz.getSuccessfulByorderId(orderId);
					// sbBiz.updateSbCancelStatus(orderId);
					// sbBiz.updateSuccessfullBidder(orderId);
					// if(SuccessFullBDDetails808.instance != null &&
					// SuccessFullBDDetails808.orderid.equals(orderId)){
					// SuccessFullBDDetails808.instance.finish();
					// SuccessFullBDDetails808.orderid = "";
					// }
					// TTsFunction.speakText("您有一条电召已被中心取消");
				} catch (Exception e) {
					// TODO: handle exception
					e.printStackTrace();
				}
				break;

			case 0x8B10: // 10.3.5.38 外围设备指令下行透传
				try {
					int num = 0;
					// TypeID
					int TypeID = (Integer) dataList.get(num++);
					// DataType
					int DataType = (Integer) dataList.get(num++);
					// 数据包
					byte[] data = (byte[]) dataList.get(num++);


					AppLog.saveTxt("收到透传指令：   typeID："+TypeID+"     datatype:"+DataType+"      data:"+Tools.parseByte2HexStr(data));
					AppLog.e("收到透传指令：   typeID："+TypeID+"     datatype:"+DataType+"      data:"+Tools.parseByte2HexStr(data));


					SerialPortService.getInstance().sendSerialData1(data);
//				DDUtil.isNeedCare(Tools.parseHexStr2Byte("7E45003A00A051564552004248472D453430234131323A313720323031362D30322D3239323233393431120B1B030E3023000000AA000000036AC5FA207E"));

				} catch (Exception e) {
					AppLog.e(ExceptionUtil.getInfo(e));
					e.printStackTrace();
				}
				break;
			case 0x8803:   //3.2.41	多媒体上传命令
				try {
					int num = 0;
					//	类型	UINT8	0x00：照片；0x01：音频；0x02：视频；其他：RFU
					int type = (Integer) dataList.get(num++);
					int mediaId = (Integer) dataList.get(num++);
					AppLog.i(TAG, "多媒体上传命令,类型:"+type+"; mediaId:"+mediaId);
					if(type == 0x00){
					/*// 照片	文件ID	UINT32
					PhotoInfoBiz photoInfoBiz = new PhotoInfoBiz(context);
					PhotoInfo info = photoInfoBiz.getInfoByMediaId(String.valueOf(mediaId));
					if(info != null){
						UploadManager.uploadAPhoto(info);
					}*/
					}else if(type == 0x01){
						// 音频
						RecorderBiz recordingBiz = new RecorderBiz(context);
						RecorderInfo info = recordingBiz.getInfoByMediaId(String.valueOf(mediaId));
						if(info != null){
							info.setSerialId(aaData.getSeq());
							RecorderUploadManager.uploadARecording(info);
						}
					}
				} catch (Exception e) {
					AppLog.e(ExceptionUtil.getInfo(e), e);
					e.printStackTrace();
				}
				break;
			case 0x8805:   //10.3.5.40 音频检索
				try {
					int num = 0;
					// 录音原因
					int typeId = (Integer) dataList.get(num++);
					// 起始时间
					String sTime = (String) dataList.get(num++);
					// 结束时间
					String eTime = (String) dataList.get(num++);

					// 应答流水号
					int seq = aaData.getSeq();

					RecorderBiz recordingBiz = new RecorderBiz(context);
					ArrayList<RecorderInfo> list = recordingBiz.findInfos(typeId, sTime, eTime);
					RecorderListUploadManager.upLoad(list, seq);
				} catch (Exception e) {
					AppLog.e(ExceptionUtil.getInfo(e), e);
					e.printStackTrace();
				}
				break;
			case 0x9501: // 实时音频传输请求
				try {

					int num = 0;

					// 服务器IP
					String ip = (String)dataList.get(num++);

					// TCP端口号
					int tcpPort = (Integer)dataList.get(num++);

					// UDP端口号
					int udpPort = (Integer)dataList.get(num++);

					// 通道号 由1开始
					int channleID = (Integer)dataList.get(num++);

					// 0：音视频，1：视频，2：双向对讲，3：监听，4：中心广播，5：透传
					int dataType = (Integer) dataList.get(num++);

					// 码流类型  0:子流码      1:主流码
					int streamType = (Integer) dataList.get(num++);

					AppLog.e("收到音视频指令：          通道id："+channleID+"         tcp端口："+tcpPort+"         udp端口："+udpPort+"          媒体通道ip："+ip+"           命令类型："+dataType);
					AudioUtil.getInstance().sendData2Tcp(ip, tcpPort, channleID, streamType, dataType);

					// 数据包
//				 byte[] data = (byte[]) dataList.get(0);
//				 byte[] allData = new byte[data.length + 2];
//				 System.arraycopy(data, 0, allData, num, data.length);
//				 num += data.length;
//				 System.arraycopy(Tools.sortToByte(Tools.int2Bytes(aaData.getSeq(), 2)), 0, allData, num, 2);
//				 num += 2;
//				 String mid = Tools.parseByte2HexStr(Tools.sortToByte(Tools.int2Bytes(msgId, 2)));
//				 VideoEncoder.sendDispatcherMsg2Recorder(allData, mid);
				} catch (Exception e) {
					AppLog.e(ExceptionUtil.getInfo(e));
					e.printStackTrace();
				}
				break;
			case 0x9509: // 实时音频传输请求
				try {
					/*
					 * int num = 0; // 服务器IP String ip = (String)
					 * dataList.get(num++); // TCP端口号 int tcpPort = (Integer)
					 * dataList.get(num++); // UDP端口号 int udpPort = (Integer)
					 * dataList.get(num++); // 通道号 由1开始 int channleID = (Integer)
					 * dataList.get(num++); // 0：音视频，1：视频，2：双向对讲，3：监听，4：中心广播，5：透传
					 * int dataType = (Integer) dataList.get(num++); // 码流类型 0:子流码
					 * 1:主流码 int streamType = (Integer) dataList.get(num++);
					 */
					// 数据包
					// int num = 0;
					// byte[] data = (byte[]) dataList.get(0);
					// byte[] allData = new byte[data.length + 2];
					// System.arraycopy(data, 0, allData, num, data.length);
					// num += data.length;
					// System.arraycopy(Tools.sortToByte(Tools.int2Bytes(aaData.getSeq(),
					// 2)), 0, allData, num, 2);
					// num += 2;
					//
					// String mid =
					// Tools.parseByte2HexStr(Tools.sortToByte(Tools.int2Bytes(msgId,
					// 2)));
					// VideoEncoder.sendDispatcherMsg2Recorder(allData, mid);
				} catch (Exception e) {
					AppLog.e(ExceptionUtil.getInfo(e));
					e.printStackTrace();
				}
				break;
			/*
			 * case 0x9102: // 音视频传输控制 try { int num = 0; // 逻辑通道号 BYTE int
			 * channleID = (Integer) dataList.get(num++); // 控制指令 BYTE
			 * 平台可以通过该指令对设备的实时音视频进行控制。0：关闭音视频传输指令 4 : 关闭双向对讲 int controlType =
			 * (Integer) dataList.get(num++); // 关闭音视频类型 BYTE 0：关闭该通道有关的音视频数据 int
			 * dataType = (Integer) dataList.get(num++); // 切换码流类型 BYTE
			 * 将之前申请的码流切换为新申请的码流，音频与切换前保持一致。新申请的码流为：0：主码流 1：子码流 int streamType =
			 * (Integer) dataList.get(num++);
			 *
			 * } catch (Exception e) { AppLog.e(ExceptionUtil.getInfo(e));
			 * e.printStackTrace(); } break; case 0x9505: // 存储音视频检索 try { int num =
			 * 0; // 查询属性 BYTE 1：音频，2：视频，3：音视频 int type = (Integer)
			 * dataList.get(num++); // 码流类型 BYTE 码流类型，0表示主码流，1表示子码流 int streamType =
			 * (Integer) dataList.get(num++); // 存储设备编号 BYTE 存储位置，0表示主存储器，1表示备份存储器
			 * int saveType = (Integer) dataList.get(num++); // 逻辑通道号 BYTE int
			 * channleID = (Integer) dataList.get(num++); // 报警类型 64BITS
			 * bit0-31见JT/T 808-2011表18报警标志位定义；全0表示无报警类型条件 int alarmType = (Integer)
			 * dataList.get(num++); // 开始时间 BCD[6] YY-MM-DD-HH-MM-SS，全0表示无起始时间
			 * String sTime = (String) dataList.get(num++); // 终止时间 BCD[6]
			 * YY-MM-DD-HH-MM-SS，全0表示无终止时间 String eTime = (String)
			 * dataList.get(num++);
			 *
			 * } catch (Exception e) { AppLog.e(ExceptionUtil.getInfo(e));
			 * e.printStackTrace(); } break; case 0x9508: // 终端搜索月历信息列表 try { int
			 * num = 0; // 查询属性 BYTE 文件类型，0表示音视频，1表示音频，2表示视频，(用户自定义扩展；3 黑匣子 4 报警日志
			 * 5用户日志） int type = (Integer) dataList.get(num++); // 码流类型 BYTE
			 * 码流类型，0表示主码流，1表示子码流；(当使用自定义扩展时此字段填0) int streamType = (Integer)
			 * dataList.get(num++); // 存储设备编号 BYTE 存储位置，0表示主存储器，1表示备份存储器， int
			 * saveType = (Integer) dataList.get(num++); // 查询模式 BYTE 月历查询 0 所有录像
			 * 1报警 (当使用自定义扩展时此字段填0) int alarmType = (Integer) dataList.get(num++);
			 * // 开始时间 BCD[2] YY-MM，全0表示无起始时间条件 查询所有年月日信息 String sTime = (String)
			 * dataList.get(num++); // 结束时间 BCD[2] YY-MM，全0表示无终止时间条件 String eTime =
			 * (String) dataList.get(num++);
			 *
			 * } catch (Exception e) { AppLog.e(ExceptionUtil.getInfo(e));
			 * e.printStackTrace(); } break; case 0x9509: // 存储音视频回放请求 try { int num
			 * = 0; // 服务器IP String ip = (String) dataList.get(num++); // TCP端口号 int
			 * tcpPort = (Integer) dataList.get(num++); // UDP端口号 int udpPort =
			 * (Integer) dataList.get(num++); // 通道号 由1开始 int channleID = (Integer)
			 * dataList.get(num++); // 音视频属性 BYTE 0：音视频，1：音频，2：视频，3：视频或音视频 int type
			 * = (Integer) dataList.get(num++); // 存储器类型 0：主存储器或灾备存储器，1：主存储器，2：灾备存储器
			 * int saveType = (Integer) dataList.get(num++); // 传输方式 BYTE
			 * 0：正常传输；1：快进跳帧传输；(暂不支持2：关键帧快退传输；(暂不支持)3：关键帧传输；(暂不支持)4、单帧传输；(暂不支持) int
			 * transType = (Integer) dataList.get(num++); // 快进或快退倍数 BYTE
			 * 传输方式为1和2时，此字段内容有效，否则置0 0：无效；1：1倍；2：2倍；3：4倍；4：8倍；5：16倍 int playType =
			 * (Integer) dataList.get(num++); // 码流类型 BYTE
			 * 0：主码流或子码流，1：主码流，2：子码流；如果此通道只传输音频，此字段置0 int streamType = (Integer)
			 * dataList.get(num++); // 开始时间 BCD[6]
			 * YY-MM-DD-HH-MM-SS，回放方式为4时，该字段表示单帧传输时刻，终端传输距离该时刻最近的关键帧。 String sTime =
			 * (String) dataList.get(num++); // 结束时间 BCD[6]
			 * YY-MM-DD-HH-MM-SS，为0表示一直回放，传输方式为4时，该字段无效 String eTime = (String)
			 * dataList.get(num++); } catch (Exception e) {
			 * AppLog.e(ExceptionUtil.getInfo(e)); e.printStackTrace(); } break;
			 * case 0x950A: // 存储音视频回放控制 try { int num = 0;
			 *
			 * // 音视频通道号 BYTE int channleID = (Integer) dataList.get(num++); // 传输控制
			 * BYTE int transType = (Integer) dataList.get(num++); // 快进或快退倍数 BYTE
			 * int count = (Integer) dataList.get(num++); // 拖动回放位置 BCD[6] //
			 * if(transType == 5){ String time = (String) dataList.get(num++); // }
			 * } catch (Exception e) { AppLog.e(ExceptionUtil.getInfo(e));
			 * e.printStackTrace(); } break;
			 */
			// case 0x9501:
			case 0x9102:
			case 0x9505:
				// case 0x9509:
			case 0x950A:
				try {
					// 数据包
					// byte[] data = (byte[]) dataList.get(0);
					// String mid =
					// Tools.parseByte2HexStr(Tools.sortToByte(Tools.int2Bytes(msgId,
					// 2)));
					// VideoEncoder.sendDispatcherMsg2Recorder(data, mid);
				} catch (Exception e) {
					AppLog.e(ExceptionUtil.getInfo(e));
					e.printStackTrace();
				}
				break;
			case 0x8804:
				//case 0x8805:
			case 0x8806:
			case 0x8807:
			case 0x8808:
			case 0x8809:
			case 0x880A:
			case 0x880B:
				try {
					// 数据包
					// byte[] data = (byte[]) dataList.get(0);
					// String mid =
					// Tools.parseByte2HexStr(Tools.sortToByte(Tools.int2Bytes(msgId,
					// 2)));
					// VideoEncoder.sendDispatcherMsg2Recorder(data, mid);
				} catch (Exception e) {
					AppLog.e(ExceptionUtil.getInfo(e));
					e.printStackTrace();
				}
				break;
			/*
			 * case 0x8804: // 实时音频传输请求 try { int num = 0; // 服务器IP String ip =
			 * (String) dataList.get(num++); // TCP端口号 int tcpPort = (Integer)
			 * dataList.get(num++); // UDP端口号 int udpPort = (Integer)
			 * dataList.get(num++); // 通道号 由1开始 int channleID = (Integer)
			 * dataList.get(num++); // 码流类型 0:子流码 1:主流码 int streamType = (Integer)
			 * dataList.get(num++); // 音视频传输时间 单位为秒 ，0表示不受时间限制 int time = (Integer)
			 * dataList.get(num++); // 多媒体数据ID >0 当多个链路同时请求时，区分不同链路 int mediaId =
			 * (Integer) dataList.get(num++); } catch (Exception e) {
			 * AppLog.e(ExceptionUtil.getInfo(e)); e.printStackTrace(); } break;
			 * case 0x8805: // 实时音视频传输关闭 try { int num = 0; // 通道号 从1开始 int
			 * channelId = (Integer) dataList.get(num++); // 多媒体数据ID >0
			 * 当多个链路同时请求时，区分不同链路 int mediaId = (Integer) dataList.get(num++);
			 *
			 * } catch (Exception e) { AppLog.e(ExceptionUtil.getInfo(e));
			 * e.printStackTrace(); } break; case 0x8806: // 实时音视频传输状态通知 try { int
			 * num = 0; // 通道号 从1开始 int channelId = (Integer) dataList.get(num++);
			 * // 丢包率评估值 int lose = (Integer) dataList.get(num++);
			 *
			 * } catch (Exception e) { AppLog.e(ExceptionUtil.getInfo(e));
			 * e.printStackTrace(); } break; case 0x8807: // 存储音视频检索 try { int num =
			 * 0; // 类型 int type = (Integer) dataList.get(num++); // 通道号 int
			 * channelId = (Integer) dataList.get(num++); // 报警类型 num ++; // 起始时间
			 * String sTime = (String) dataList.get(num++); // 终止时间 String eTime =
			 * (String) dataList.get(num++); } catch (Exception e) {
			 * AppLog.e(ExceptionUtil.getInfo(e)); e.printStackTrace(); } case
			 * 0x8808: // 存储音视频回放 try { int num = 0; // 多媒体数据ID int mediaId =
			 * (Integer) dataList.get(num++); // 服务器IP String ip = (String)
			 * dataList.get(num++); // TCP端口号 int tcpPort = (Integer)
			 * dataList.get(num++); // UDP端口号 int udpPort = (Integer)
			 * dataList.get(num++); // 视频通道号 int channel = (Integer)
			 * dataList.get(num++); // 音视频标识 0：视频 1：音频 2：音视频混传 int flag = (Integer)
			 * dataList.get(num++); // 码流类型 int type = (Integer)
			 * dataList.get(num++); // 开始时间 String sTime = (String)
			 * dataList.get(num++);
			 *
			 * } catch (Exception e) { AppLog.e(ExceptionUtil.getInfo(e));
			 * e.printStackTrace(); } break; case 0x8809: // 存储音视频回放 try { int num =
			 * 0; // 多媒体数据ID int mediaId = (Integer) dataList.get(num++); // 回放控制
			 * int type = (Integer) dataList.get(num++); if(type == 3){ // 快进幅度 int
			 * range = (Integer) dataList.get(num++); }else if(type == 4){ // 拖动时间
			 * String time = (String) dataList.get(num++); }
			 *
			 * } catch (Exception e) { AppLog.e(ExceptionUtil.getInfo(e));
			 * e.printStackTrace(); } break; case 0x880A: //存储音视频上传请求 try { int num
			 * = 0; // 服务器地址 String addr = (String) dataList.get(num++); // 端口号 int
			 * port = (Integer) dataList.get(num++); // 用户名 String user = (String)
			 * dataList.get(num++); // 密码 String pwd = (String) dataList.get(num++);
			 * // 文件上传路径 String path = (String) dataList.get(num++); // 通道号 int
			 * channelId = (Integer) dataList.get(num++); // 起始时间 String startTime =
			 * (String) dataList.get(num++); // 终止时间 String endTime = (String)
			 * dataList.get(num++);
			 *
			 * } catch (Exception e) { AppLog.e(ExceptionUtil.getInfo(e));
			 * e.printStackTrace(); } break; case 0x880B: //存储音视频上传停止 try { int num
			 * = 0; // 端口号 int type = (Integer) dataList.get(num++); String[] files
			 * = (String[]) dataList.get(num++);
			 *
			 * } catch (Exception e) { AppLog.e(ExceptionUtil.getInfo(e));
			 * e.printStackTrace(); } break;
			 */
			case 0x8B0A: // 中心确认报警
				try {
					AppLog.i("报警------------------------中心确认报警");
					DDUtil.sendText2TT(2);
					ConstantsAram.setAlarmStateValue(0, 1);
					ConstantsAram.setAlarmStateValue(1, 0);
					// 终端通用应答
					DispatchCenterUsers.witeMsg(Encoder.getTerminalGeneralResponse(
							aaData.getSeq(), msgId, 0), 0);
				} catch (Exception e) {
					AppLog.e(ExceptionUtil.getInfo(e));
					e.printStackTrace();
				}
				break;
			case 0x8B0B: // 中心解除报警
				try {
					DDUtil.sendText2TT(6);
					KeyBroadcast.baojing = false;
					RecordTimer.recordReason = 0;
					// 停止录音
					if (RecorderBiz.getRecordType() == 2) {
						if (MyStatus.zhongche) {
							// 重车,继续录音
							RecordTimer.mediaIdList = new ArrayList<String>();
						} else {
							// 空车，结束录音
							SerialPortService.handler.obtainMessage(1008).sendToTarget();
						}
					}
					AppLog.i("报警------------------------中心解除报警");
					ConstantsAram.setAlarmStateValue(0, 0);
					ConstantsAram.setAlarmStateValue(1, 0);

					// 终端通用应答
					DispatchCenterUsers.witeMsg(Encoder.getTerminalGeneralResponse(
							aaData.getSeq(), msgId, 0), 0);

//				byte[] heartBeatByte = Encoder.getLocationInformation();
//				DispatchCenterUsers.witeMsg(heartBeatByte, 0);

				} catch (Exception e) {
					AppLog.e(ExceptionUtil.getInfo(e));
					e.printStackTrace();
				}
				break;
			case 0x8B11: // 中心巡检设备
				try {
					int num = 0;
					// 巡检设备类型代码
					int[] typeList = (int[]) dataList.get(num++);
				} catch (Exception e) {
					AppLog.e(ExceptionUtil.getInfo(e));
					e.printStackTrace();
				}
				break;
			case 0x8C01: // 防伪密标
				try {
					int num = 0;
					// 显示开关 0：开始显示 1：停止显示
					int type = (Integer) dataList.get(num++);
					// 显示时长 单位为S，值为0时不做时长控制，显示开关为1时有效
					int time = (Integer) dataList.get(num++);
					byte[] data = (byte[]) dataList.get(num++);
				} catch (Exception e) {
					AppLog.e(ExceptionUtil.getInfo(e));
					e.printStackTrace();
				}
				break;
			case 0x8B50: // 出租车司机卡黑名单信息查询响应
				try {
					int num = 0;
					// 应答流水号 对应查询指令流水号
					int serialCode = (Integer) dataList.get(num++);
					// 应答ID 对应查询指令ID
					int responseId = (Integer) dataList.get(num++);
					// 基本库版本 YYMMDD 000000表示系统当前无黑名单号
					String baseVersion = (String) dataList.get(num++);
					// 增量库版本 YYMMDD 000000表示系统当前无黑名单号
					String secondVersion = (String) dataList.get(num++);
				} catch (Exception e) {
					AppLog.e(ExceptionUtil.getInfo(e));
					e.printStackTrace();
				}
				break;
			case 0x8B51: // 出租车司机卡黑名单信息下载响应
				try {
					int num = 0;
					// 应答流水号 对应下载指令流水号
					int serialCode = (Integer) dataList.get(num++);
					// 应答ID 对应下载指令ID
					int responseId = (Integer) dataList.get(num++);
					// 黑名单版本 YYMMDD 000000表示系统当前无黑名单号
					String baseVersion = (String) dataList.get(num++);
					// 下载类型 0：基本库下载 1：增量库下载
					int downloadType = (Integer) dataList.get(num++);
					// 是否支持数据压缩 0：不支持 1：支持
					int compress = (Integer) dataList.get(num++);
					// arithmetic 支持数据压缩算法 0：无 1：gz；.....
					int arithmetic = (Integer) dataList.get(num++);
					// 数据包总数
					int pkgCount = (Integer) dataList.get(num++);
					// 当前包ID
					int pkgNum = (Integer) dataList.get(num++);
					// 数据
					byte[] data = (byte[]) dataList.get(num++);
				} catch (Exception e) {
					AppLog.e(ExceptionUtil.getInfo(e));
					e.printStackTrace();
				}
				break;
			case 0x8B52: // 出租车司机卡黑名单更新通知
				try {
					int num = 0;
					// 基本库版本 YYMMDD 000000表示系统当前无黑名单号
					String baseVersion = (String) dataList.get(num++);
					// 增量库版本 YYMMDD 000000表示系统当前无黑名单号
					String secondVersion = (String) dataList.get(num++);
				} catch (Exception e) {
					AppLog.e(ExceptionUtil.getInfo(e));
					e.printStackTrace();
				}
				break;
			case 0x8BF4:   //  声耕设备升级指令FocalAcoustics
				try {
					int num = 0;
					//设备版本号ID
					int deviceID = (int) dataList.get(num++);
					//版本号
					String acousticsVersion = (String) dataList.get(num++);
					//用户名
					String useName = (String) dataList.get(num++);
					//密码
					String password = (String) dataList.get(num++);
					//端口UINT16
					int ftpPort = (int) dataList.get(num++);
					//升级地址
					String ftpPath = (String) dataList.get(num++);
					//文件名
					String fileName = (String) dataList.get(num++);
					//文件大小UINT32
					int fileSize = (int) dataList.get(num++);
					//CRC校验UINT16
					String crcCheckSum = (String)dataList.get(num++);
					if(num + 1 < dataList.size()){
						//文件生效类型UINT8 0:默认文件生效.1:根据文件生效日期
						int effectiveType = (int) dataList.get(num++);
						AppLog.d(TAG, "声耕升级 effectiveType:" + effectiveType);
						if(num + 1 < dataList.size()){
							//文件生效时间BCD[6] yymmddyymmdd沙迦项目使用
							String timeLimit = (String)dataList.get(num++);
							AppLog.d(TAG, "声耕升级 timeLimit:" + timeLimit);
						}

					}
					AppLog.d(TAG, "声耕升级 deviceID:" + deviceID + " acousticsVersion:" + acousticsVersion + " useName:" + useName + " password:" + password);
					AppLog.d(TAG, "声耕升级 ftpPort:" + ftpPort + " ftpPath:" + ftpPath + " fileName:" + fileName + " fileSize:" + fileSize + " crcCheckSum:" + crcCheckSum);

					if(MCUUtil.mVoiceTool.focalAcousticsUpgrade.versionCheck(acousticsVersion)){
						MCUUtil.mVoiceTool.focalAcousticsUpgrade.responseState.setConfig(aaData.getSeq(),deviceID,acousticsVersion);
						MCUUtil.mVoiceTool.focalAcousticsUpgrade.responseState.setResponseStateListener(new ResponseState.ResponseStateListener() {
							@Override
							public void onResponseState(int seq,int deviceID,String version,int state) {
								DispatchCenterUsers.witeMsg(Encoder.getTerminalFocalAcousticsResponse(seq, deviceID,version,state), 0);
							}
						});
						//下载升级
						MCUUtil.mVoiceTool.focalAcousticsUpgrade.doCheckFTP(ftpPath,ftpPort,useName,password,fileName,fileSize,crcCheckSum);
					}else{
						DispatchCenterUsers.witeMsg(Encoder.getTerminalFocalAcousticsResponse(aaData.getSeq(), deviceID,acousticsVersion,MCUUtil.mVoiceTool.focalAcousticsUpgrade.getResultState()), 0);
					}
				} catch (Exception e) {
					AppLog.e(ExceptionUtil.getInfo(e));
					e.printStackTrace();
				}
				break;
			/*
			 * case 0x8805: //10.3.5.40 音频检索 try { int num = 0; // 录音原因
			 *
			 * // 起始时间
			 *
			 * // 结束时间
			 *
			 * } catch (Exception e) { AppLog.e(ExceptionUtil.getInfo(e));
			 * e.printStackTrace(); } break;
			 */

			/*
			 * case 0x8B0A: //10.3.5.43 中心确认报警 try { // 无消息体，ISU回复通用应答。
			 *
			 * } catch (Exception e) { AppLog.e(ExceptionUtil.getInfo(e));
			 * e.printStackTrace(); } break;
			 */
			/*
			 * case 0x8B0B: //10.3.5.44 中心解除报警 try { // 无消息体，ISU回复通用应答。
			 *
			 * } catch (Exception e) { AppLog.e(ExceptionUtil.getInfo(e));
			 * e.printStackTrace(); } break;
			 */
			/*
			 * case 0x8B11: //10.3.5.45 中心巡检设备 try { int num = 0; // 巡检设备类型代码
			 *
			 * } catch (Exception e) { AppLog.e(ExceptionUtil.getInfo(e));
			 * e.printStackTrace(); } break;
			 */

			case 0x8900: // 3.2.51 下行透传
				try {
					int num = 0;
					// 数据类型 UINT8
					int fileType = (Integer) dataList.get(num++);
					// 厂商标识（二级类型） UINT32
					int vendorId = (Integer) dataList.get(num++);
					// 数据包 UINT8[]
					byte[] data = (byte[]) dataList.get(num);
					AppLog.i("数据类型:" + fileType + "; 厂商标识（二级类型）:" + vendorId);
					AppLog.i("下行透传,数据包:" + Tools.parseByte2HexStr(data));
				} catch (Exception e) {
					AppLog.e(ExceptionUtil.getInfo(e));
					e.printStackTrace();
				}
				break;

			case 0x8D00: // 3.2.54 电子服务证下发
				try {
					// int num = 0;
					// int pkgInfo = (Integer) dataList.get(num++);
					// int pkgCount = (Integer) dataList.get(num++);
					// int pkgNum = (Integer) dataList.get(num++);
					// if(pkgInfo == 0 || pkgNum == 1){
					// // 司机姓名 STRING
					// String name = (String) dataList.get(num++);
					// // 服务公司 STRING
					// String company = (String) dataList.get(num++);
					// // 司机代码 BCD[6]
					// String driverCode = (String) dataList.get(num++);
					// // 驾驶员唯一编号 BYTE[50]
					// String uniqueCode = (String) dataList.get(num++);
					// // 星级 BCD
					// String level = (String) dataList.get(num++);
					// // 星级显示文本 STRING
					// String levelText = (String) dataList.get(num++);
					// // 照片格式编码 BYTE
					// int fileType = (Integer) dataList.get(num++);
					// // 窗口大小 BYTE
					// int windowSize = (Integer) dataList.get(num++);
					// //电子服务证版本 BCD[6]
					// String version = (String) dataList.get(num++);
					//
					// // 保存司机信息
					// DriverInfo info = new DriverInfo();
					// info.setCompany(company);
					// info.setDriverCode(driverCode);
					// info.setElectronicalVersion(version);
					// info.setGrade(Integer.parseInt(level));
					// info.setGradeText(levelText);
					// info.setName(name);
					// info.setUniqueCode(uniqueCode);
					// DriverInfoBiz.getInstance().addInfo(info);
					//
					// DriverInfoBiz.saveCurrentDriverCode(driverCode);
					// DriverInfoBiz.setCurrentDriver(null);
					//
					// DriverInfoBiz.driverData = new String[pkgCount];
					// }
					// // 照片内容 UINT8[]
					// String data = (String) dataList.get(num++);
					// DriverInfoBiz.driverData[pkgNum-1] = data;
					// if(pkgCount == pkgNum){
					// StringBuffer builder = new StringBuffer();
					// for(int i = 0;i<DriverInfoBiz.driverData.length;i++){
					// String text = DriverInfoBiz.driverData[i];
					// /*System.out.println("第 "+i+" 个包长度数据长度："+(text.length()/2));
					// System.out.println("==="+text);*/
					// if(StringUtil.isNull(text)){
					// if(DriverInfoBiz.requestCount > 0){
					// DriverInfoBiz.requestCount --;
					// DriverInfoBiz.questElectronicalInfo();
					// }
					// break;
					// }
					// builder.append(text);
					// }
					// byte[] driverPhotoByte =
					// Tools.parseHexStr2Byte(builder.toString());
					// DriverInfoBiz.saveDriverPhoto(driverPhotoByte);
					// /*Intent intent = new Intent(context,
					// DriverPhotoActivity.class);
					// intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
					// intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
					// context.startActivity(intent);*/
					// }
				} catch (Exception e) {
					AppLog.e(ExceptionUtil.getInfo(e));
					e.printStackTrace();
				}
				break;

			case 0x8D01: // 3.2.57 文件下发
				try {
					int num = 0;
					// 文件类型 BYTE
					int fileType = (Integer) dataList.get(num++);
					// 文件名 STRING
					String fileName = (String) dataList.get(num++);
					// 窗口大小 BYTE
					int windowSize = (Integer) dataList.get(num++);
					// 文件校验 BYTE
					int fileCheck = (Integer) dataList.get(num++);
					// 文件内容 BYTE[]
					byte[] data = (byte[]) dataList.get(num++);
				} catch (Exception e) {
					AppLog.e(ExceptionUtil.getInfo(e));
					e.printStackTrace();
				}
				break;

			case 0x8D02: // 3.2.58 密钥更新通知
				try {
					int num = 0;
					// 密钥类型 UINT8 0：PSAM 1：ESAM
					int keyType = (Integer) dataList.get(num++);
					// 文件标识符 UINT16
					int fileCode = (Integer) dataList.get(num++);
				} catch (Exception e) {
					AppLog.e(ExceptionUtil.getInfo(e));
					e.printStackTrace();
				}

				break;

			case 0x8D03: // 3.2.59 密钥内容下发
				try {
					int num = 0;
					// 密钥类型 UINT8 0：PSAM 1：ESAM
					int keyType = (Integer) dataList.get(num++);
					// 装载密文 UINT8[33]
					int cipherText = (Integer) dataList.get(num++);
					// 密钥版本 BCD[7] YYYYMMDDhhmmss
					String keyVersion = (String) dataList.get(num++);
					// 同步号 UINT32 与密钥更新请求中的一致
					int brotherCode = (Integer) dataList.get(num++);
					// 是否更新结束 UINT8 1：最后一条密钥
					int end = (Integer) dataList.get(num++);
				} catch (Exception e) {
					AppLog.e(ExceptionUtil.getInfo(e));
					e.printStackTrace();
				}

				break;

			case 0x5202: // 扫描支付通知
				try {
					// 支付结果 // 1 成功 2 失败
					// int result = (Integer) dataList.get(0);
					// // 订单号
					// String orderNumber = (String) dataList.get(1);
					// AppLog.i( "订单号："+orderNumber+"; 支付结果："+result);
					// if(PayActivity.handler != null){
					// // 订单号与当前二维码界面订单号是否相同
					// if(orderNumber.equals(PayConstants.orderNO)){
					// PayActivity.handler.obtainMessage(1002,
					// result).sendToTarget();
					// }else{
					// NetworkHandler.showPayResult(orderNumber, result);
					// }
					// }else{
					// NetworkHandler.showPayResult(orderNumber, result);
					// }
				} catch (Exception e) {
					AppLog.e(ExceptionUtil.getInfo(e));
					e.printStackTrace();
				}
				break;

			/**************************************** 电召业务开始 ******************************************/
			/*
			 * case 0x5209: //语音叫车 try { AppLog.i(
			 * "招标信息是否接收 true 接收 false 不接收=="+Constants.INVITE_BIDS_INFO);
			 * if(Constants.INVITE_BIDS_INFO && dataList.size() > 0){ int num = 0;
			 * // 定单号 String String orderId = (String) dataList.get(num++); // 订单时间
			 * String orderTime = (String) dataList.get(num++); // 抢答方式 BYTE
			 * 0x01：电话抢答，司机抢答后，车台应拨打该协议中带下来的抢答电话号码。 //
			 * 0x02：无线抢答，司机抢答后，车台应向中心发送7CH应答帧 int qdfs = (Integer)
			 * dataList.get(num++); // 乘客姓名 String String passengerName = (String)
			 * dataList.get(num++); // 抢答电话号码 String 乘客电话号码 String phoneNumber =
			 * (String) dataList.get(num++); // 开始经度 DWORD 乘客起点地址 double startLng=
			 * (Integer) dataList.get(num++) * 1E-6; // 开始纬度 DWORD 乘客起点地址 double
			 * startLat= (Integer) dataList.get(num++) * 1E-6; // 出发地 String
			 * starting = (String) dataList.get(num++); // 录音文件 String String url =
			 * (String) dataList.get(num++); // 调度简短信息 String 文本描述 String text =
			 * (String) dataList.get(num++);
			 *
			 * if(!StringUtil.isNull(phoneNumber) && phoneNumber.startsWith("0")){
			 * phoneNumber = phoneNumber.substring(1); }
			 *
			 * Invitation invitation = new Invitation();
			 * invitation.setOrderid(orderId); invitation.setAnswertype(qdfs);
			 * invitation.setPhone(phoneNumber);
			 * invitation.setBeginlat(String.valueOf(startLat));
			 * invitation.setBeginlon(String.valueOf(startLng));
			 * invitation.setRemark(text);
			 *
			 * invitation.setOrderType(RadioCallConstants.ORDER_TYPE_VOICE);
			 * invitation.setOrderSource(RadioCallConstants.ORDER_SOURCE_808);
			 * invitation.setOrderTime(DateUtil.dateTimeFormat(orderTime));
			 * invitation.setStarting(starting); invitation.setUrl(url);
			 * invitation.setPassengerName(passengerName); String message =
			 * InvitationBiz.getMessage(invitation); invitation.setMessage(message);
			 *
			 * //往数据中插入招标信息 InvitationBiz biz = new InvitationBiz(context);
			 * if(biz.getInvitationCount()>=100){ biz.deleteFirstInvitation(); }
			 * biz.insertInvitation(invitation);
			 *
			 * //跳转到抢答页面 Intent intent = new Intent(); intent.setClass(context,
			 * Responder808.class); intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
			 * Bundle bundle = new Bundle(); bundle.putSerializable("invitation",
			 * invitation); intent.putExtras(bundle); context.startActivity(intent);
			 * } } catch (Exception e) { AppLog.e(ExceptionUtil.getInfo(e));
			 * e.printStackTrace(); } break; case 0x5203: //招标 try { AppLog.i(
			 * "招标信息是否接收 true 接收 false 不接收=="+Constants.INVITE_BIDS_INFO);
			 * if(Constants.INVITE_BIDS_INFO && dataList.size() > 0){ int num = 0;
			 * // 0.定单号 String String orderId = (String) dataList.get(num++); //
			 * 1.订单时间 String orderTime = (String) dataList.get(num++); // 2.抢答方式
			 * BYTE 0x01：电话抢答，司机抢答后，车台应拨打该协议中带下来的抢答电话号码。 //
			 * 0x02：无线抢答，司机抢答后，车台应向中心发送7CH应答帧 int qdfs = (Integer)
			 * dataList.get(num++); // 3.订单类型 int orderType = (Integer)
			 * dataList.get(num++); // 4.乘客姓名 String String passengerName = (String)
			 * dataList.get(num++); // 5.抢答电话号码 String 乘客电话号码 String phoneNumber =
			 * (String) dataList.get(num++); // 6.开始经度 DWORD 乘客起点地址 double startLng=
			 * (Integer) dataList.get(num++) * 1E-6; // 7.开始纬度 DWORD 乘客起点地址 double
			 * startLat= (Integer) dataList.get(num++) * 1E-6; // 8.出发地 String
			 * String starting = (String) dataList.get(num++); // 9.结束经度 DWORD
			 * 乘客目的地地址 double endtLng= (Integer) dataList.get(num++) * 1E-6; //
			 * 10.结束纬度 DWORD 乘客目的地地址 double endLat= (Integer) dataList.get(num++) *
			 * 1E-6; // 11.目的地 String String destination = (String)
			 * dataList.get(num++); // 12.调度简短信息 String 文本描述 String text = (String)
			 * dataList.get(num++);
			 *
			 * if(!StringUtil.isNull(phoneNumber) && phoneNumber.startsWith("0")){
			 * phoneNumber = phoneNumber.substring(1); }
			 *
			 * Invitation invitation = new Invitation();
			 * invitation.setOrderSource(RadioCallConstants.ORDER_SOURCE_808);
			 * invitation.setOrderid(orderId); invitation.setAnswertype(qdfs);
			 * invitation.setPhone(phoneNumber);
			 * invitation.setBeginlat(String.valueOf(startLat));
			 * invitation.setBeginlon(String.valueOf(startLng));
			 * invitation.setEndlat(String.valueOf(endLat));
			 * invitation.setEndlon(String.valueOf(endtLng));
			 *
			 * invitation.setPassengerName(passengerName);
			 * invitation.setOrderType(orderType);
			 * invitation.setOrderTime(DateUtil.dateTimeFormat(orderTime));
			 * invitation.setStarting(starting);
			 * invitation.setDestination(destination); invitation.setRemark(text);
			 * String message = InvitationBiz.getMessage(invitation);
			 * invitation.setMessage(message);
			 *
			 * //往数据中插入招标信息 InvitationBiz biz = new InvitationBiz(context);
			 * if(biz.getInvitationCount()>=100){ biz.deleteFirstInvitation(); }
			 * biz.insertInvitation(invitation);
			 *
			 * //跳转到抢答页面 Intent intent = new Intent(); intent.setClass(context,
			 * Responder808.class); intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
			 * Bundle bundle = new Bundle(); bundle.putSerializable("invitation",
			 * invitation); intent.putExtras(bundle); context.startActivity(intent);
			 * } } catch (Exception e) { AppLog.e(ExceptionUtil.getInfo(e));
			 * e.printStackTrace(); } break; case 0x5204: //抢答确认 try { AppLog.i(
			 * "--------------------808电召抢答确认"); if(Responder808.instance!=null){
			 *
			 * int num = 0; // 结果 BYTE 类型（1） 0x00 失败；0x01 成功;0x02 电召已被抢答 int result
			 * = (Integer) dataList.get(num++);
			 *
			 * //关闭抢答页面先判断列表页面是否存在，如果存在则先关闭 if(InvitationList.instance != null){
			 * InvitationList.instance.finish(); }
			 *
			 * //关闭发送timer ResponderTimer responderTimer = new ResponderTimer();
			 * responderTimer.stopTimer();
			 *
			 *
			 * if( result == 0){ TTsFunction.speakTextDelay("抢答失败", 1000); //
			 * NetworkHandler.showToastForCustom("抢答失败"); //
			 * NetworkHandler.showToastForCustom("抢答失败"); }else if(result == 1){ //
			 * NetworkHandler.showToastForCustom("发送成功"); //
			 * TTsFunction.speakTextDelay("抢答请求发送成功", 1000); //
			 * NetworkHandler.showToastForCustom("抢答请求发送成功"); }else if(result == 2){
			 * // NetworkHandler.showToastForCustom("电召已被其他司机抢答");
			 * TTsFunction.speakTextDelay("电召已被其他司机抢答", 1000); //
			 * NetworkHandler.showToastForCustom("电召已被其他司机抢答");
			 *
			 * } //关闭抢答界面 if(Responder808.instance != null){
			 * Responder808.instance.finish(); } } } catch (Exception e) {
			 * AppLog.e(ExceptionUtil.getInfo(e)); e.printStackTrace(); } break;
			 * case 0x5205: //电召中心处理结果 String orderId5205 = ""; int resultCode = 2;
			 * try { if(dataList.size()>0){
			 *
			 * int num = 0; // 定单号 String orderId5205 = (String)
			 * dataList.get(num++); //处理结果 BYTE 0x01 抢答失败 0x02 取消电召 int result =
			 * (Integer) dataList.get(num++);
			 *
			 * if(result == 1){ TTsFunction.speakTextDelay("抢答失败", 1000); }else{
			 * TTsFunction.speakTextDelay("中心已取消", 1000); } if(Responder808.instance
			 * != null){ Responder808.instance.finish(); } resultCode = 1; }else{
			 * resultCode = 2; } } catch (Exception e) {
			 * AppLog.e(ExceptionUtil.getInfo(e)); e.printStackTrace(); resultCode =
			 * 2; } // 电召中心处理结果应答 DispatchCenterUsers.witeMsg(QHEncoder.
			 * getCallCenterProcessingResultsAnswer(orderId5205,resultCode), 0);
			 * break; case 0x5206: //中标 try { int num = 0; // 定单号 String final
			 * String orderId = (String) dataList.get(num++); // 乘客姓名 String String
			 * passengerName = (String) dataList.get(num++); // 乘客电话 String String
			 * phoneNumber = (String) dataList.get(num++); // 车牌号 String
			 * 平台用于填充电召业务流水号 String carNumber = (String) dataList.get(num++); //
			 * 描述信息 String 描述乘客所在的位置 String addr = (String) dataList.get(num++); //
			 * 本机手机号 String String myPhone = (String) dataList.get(num++); // 电召费
			 * String 浮点字符，如1.1元 1.9元 String fee = (String) dataList.get(num++);
			 *
			 * if(SuccessFullBDList.instance != null){
			 * SuccessFullBDList.instance.finish(); }
			 *
			 * //往数据中插入中标订单 SuccessBidderBiz sbBiz = new SuccessBidderBiz(context);
			 * SuccessfullBidder sb = new SuccessfullBidder();
			 *//**
			 * 判断乘客号码第一位是否为0，是截掉，否保留
			 */
			/*
			 * if(phoneNumber.substring(0, 1).equals("0")){ phoneNumber =
			 * phoneNumber.substring(1,phoneNumber.length()); }
			 * sb.setPassengerPhoneNum(phoneNumber);
			 *
			 * // 保存到数据库乘客信息表，24小时内，该号码可以呼叫本机号码，否则，直接挂断
			 * if(!StringUtil.isNull(phoneNumber)){ long time =
			 * System.currentTimeMillis(); PassengerInfo info = new PassengerInfo();
			 * info.setPhoneNumber(phoneNumber);
			 * info.setRecordTime(String.valueOf(time)); PassengerBiz biz = new
			 * PassengerBiz(context); biz.addPassengerInfo(info); }
			 *
			 * sb.setIsdone(0); sb.setIspush(0); sb.setOrderid(orderId);
			 * sb.setCarnumber(carNumber); sb.setRemark(addr); sb.setFee(fee);
			 * sb.setLocalNuber(myPhone);
			 *
			 * //根据ID查询超标信息 InvitationBiz invitationBiz = new
			 * InvitationBiz(context); Invitation invitation =
			 * invitationBiz.getInvitationByorderId(orderId);
			 * sb.setLon(invitation.getBeginlon());
			 * sb.setLat(invitation.getBeginlat());
			 *
			 * sb.setStarting(invitation.getStarting());
			 * sb.setOrderTime(invitation.getOrderTime());
			 * sb.setOrderSource(invitation.getOrderSource());
			 * sb.setOrderType(invitation.getOrderType());
			 * sb.setPassengerName(passengerName); if(sb.getOrderType() ==
			 * RadioCallConstants.ORDER_TYPE_VOICE){ sb.setUrl(invitation.getUrl());
			 * }else{ sb.setDestination(invitation.getDestination()); }
			 * sb.setMessage(SuccessBidderBiz.getMessage(sb));
			 *
			 * if(sbBiz.getSuccessFullCount(0)>=100){
			 * sbBiz.deleteFirstSuccessfullBidder(); }
			 *
			 * final long id = sbBiz.insertSuccessfullBidder(sb);
			 * //如果当前正在中标界面，则SUCCESSFUL_BIDS_INFO为false，但是如果此时收到中标信息
			 * //要等这条信息处理完后接着播报。 if(Constants.SUCCESSFUL_BIDS_INFO){ //跳转到中标界面
			 * SerialPortService.handler.postDelayed(new Runnable() {
			 *
			 * @Override public void run() { // TODO Auto-generated method stub
			 * Intent intent1 = new Intent(); intent1.setClass(context,
			 * SuccessFullBDDetails808.class);
			 * intent1.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
			 * intent1.putExtra("orderid", orderId); intent1.putExtra("id",
			 * String.valueOf(id)); context.startActivity(intent1);
			 *
			 * //TTS阅读 TTsFunction.speakText("您的电召抢答成功"); } }, 1000); }
			 *//** 添加预约提醒 */
			/*
			 * if(sb.getOrderType() == RadioCallConstants.ORDER_TYPE_ADVANCE){
			 * SuccessfullBidder newSb = sbBiz.getSuccessfulByorderId(orderId);
			 * sbBiz.addAdvanceAlarm(newSb); } } catch (Exception e) {
			 * AppLog.e(ExceptionUtil.getInfo(e)); e.printStackTrace(); } break;
			 * case 0x5207: //执行电召确认 try { int num = 0; // 处理结果 BYTE 0x00 失败；0x01 成功
			 * int result = (Integer) dataList.get(num++);
			 *
			 * try { if(RadioCallConstants.RADIO_CALL_RESULTS ==1){ //更改中标订单表中的标志
			 * SuccessBidderBiz biz = new SuccessBidderBiz(context);
			 * biz.updateSuccessfullBidderByid(RadioCallConstants.ID);
			 * TTsFunction.speakTextDelay("电召执行成功", 1000); // 删除预约提醒
			 * SuccessfullBidder sb =
			 * biz.getSuccessfulById(String.valueOf(RadioCallConstants.ID));
			 * biz.deleteAdvanceAlarm(sb,0); //
			 * NetworkHandler.showToastForCustom("执行成功"); //
			 * RadioCallConstants.RADIO_CALL_SURCHARGE = ""; //充值参数
			 * RadioCallConstants.BUSINESS_TRANSACTION = ""; RadioCallConstants.ID =
			 * ""; } } catch (Exception e) { AppLog.e(ExceptionUtil.getInfo(e));
			 * e.printStackTrace(); }
			 *
			 * //执行电召后，判断列表页面是否存在，如果存在先关闭 if(SuccessFullBDList.instance != null){
			 * SuccessFullBDList.instance.finish(); }
			 *
			 * //停止发送timer DoCallTimer doCallTimer = new DoCallTimer();
			 * doCallTimer.stopTimer();
			 *
			 * SuccessFullBDDetails808.instance.finish();
			 *//** 不用回到列表界面，直接关闭即可 */
			/*
			 * Intent intent1 = new Intent(); intent1.setClass(context,
			 * SuccessFullBDList.class);
			 * intent1.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
			 * context.startActivity(intent1); } catch (Exception e) {
			 * AppLog.e(ExceptionUtil.getInfo(e)); e.printStackTrace(); } break;
			 */
			/**************************************** 电召业务结束 ******************************************/
		}
	}

	private static void doAnswer(ArrayList<Object> dataList, Context context) {
		// TODO Auto-generated method stub
		try {
			int num = 0;
			// 应答流水号
			int rsn = (Integer) dataList.get(num++);
			// 应答ID
			int responseId = (Integer) dataList.get(num++);
			// 结果
			int result = (Integer) dataList.get(num++);
			switch (responseId) {
				case 0x0200:
					try {
						//					AppLog.i(TAG, "位置信息汇报应答，result:"+result);
//					ConstantsAram.clearAlarmStateValue();
						LocalInfoBiz.getInstance().clearLacationInfoData();
					} catch (Exception e) {
						// TODO Auto-generated catch block
						e.printStackTrace();
					}
					break;
				/*
				 * case 0x0102: if(result == 0x00){ //鉴权成功 AppLog.i("【通讯平台】鉴权成功!");
				 *
				 * SerialPortService.handler.postDelayed(new Runnable() {
				 *
				 * @Override public void run() { // TODO Auto-generated method stub
				 * // 向主界面更新连接状态
				 * ActivityMain.getInstance().handler.obtainMessage(104,
				 * Constants.STATUS_AU_SUCCESS).sendToTarget(); } }, 2000);
				 *
				 * //设置连接标志为已连接 if(DispatchCenterUsers.timerAuth != null){
				 * AppLog.i("【通讯平台】关闭鉴权定时器......");
				 * DispatchCenterUsers.timerAuth.cancel(); }
				 *
				 * //启动心跳维持连接 DispatchCenterUsers.startHeartBeat();
				 *
				 * // 交易数据补传 // BusinessUsers.startTimerBusiness(true); }else{
				 * AppLog.i("【通讯平台】鉴权失败!"); try { // 向主界面更新连接状态
				 * if(MainFragment.handler != null){
				 * ActivityMain.getInstance().handler.obtainMessage(104,
				 * Constants.STATUS_AU_FAILURE).sendToTarget(); } } catch (Exception
				 * e) { AppLog.e(ExceptionUtil.getInfo(e)); e.printStackTrace(); }
				 *
				 * } break;
				 */
				case 0x0301:
					if(result == 0){
						TTsFunction.speakText("事件报告成功");
						ToastUtils.showToastForCustom("事件报告成功");
						EventBiz biz = new EventBiz(context);
						biz.updateDownStatus(EventActivity.info.getId());
						SerialPortService.handler.postDelayed(new Runnable() {
							@Override
							public void run() {
								// TODO Auto-generated method stub
								if(EventList.instance != null){
									EventList.instance.finish();
								}
								if(EventActivity.instance != null){
									EventActivity.instance.finish();
								}
							}
						}, 2000);
					}
					break;
				case 0x0302:
					if(result == 0){
						TTsFunction.speakText("答案提交成功");
						ToastUtils.showToastForCustom("答案提交成功");
						QuestionBiz questionBiz = new QuestionBiz(context);
						questionBiz.updateDownStatus(QuestionActivity.info);
						SerialPortService.handler.postDelayed(new Runnable() {

							@Override
							public void run() {
								// TODO Auto-generated method stub
								if(QuestionList.instance != null){
									QuestionList.instance.finish();
								}
								if(QuestionActivity.instance != null){
									QuestionActivity.instance.finish();
								}
							}
						}, 2000);
					}
					break;
				case 0x0b01:
					if (result == 0) {
						TTsFunction.speakText("抢答请求发送成功");
					}
					break;
				case 0x0B07:
					// if(result == 0){
					// TTsFunction.speakText("执行成功");
					// if(SuccessFullBDList.instance != null){
					// SuccessFullBDList.instance.finish();
					// }
					// //更改中标订单表中的标志
					// SuccessBidderBiz biz = new SuccessBidderBiz(context);
					// biz.updateSuccessfullBidderByid(RadioCallConstants.ID);
					// // 删除预约提醒
					// SuccessfullBidder sb =
					// biz.getSuccessfulById(String.valueOf(RadioCallConstants.ID));
					// biz.deleteAdvanceAlarm(sb,0);
					// // NetworkHandler.showToastForCustom("执行成功");
					// // RadioCallConstants.RADIO_CALL_SURCHARGE = "";
					// //充值参数
					// RadioCallConstants.BUSINESS_TRANSACTION = "";
					// RadioCallConstants.ID = "";
					// SuccessBidderBiz sbBiz = new SuccessBidderBiz(context);
					// int noDoCount = sbBiz.getNotDOInstantCallCount();
					// if(noDoCount >0){
					// Constants.hasInstantCall = true;
					// }else{
					// Constants.hasInstantCall = false;
					// }
					// }
					break;
				case 0x0A00:
					// if(result == 0){
					// if(BusinessUsers.isRepost()){
					// if(--BusinessUsers.postCount == 0){
					// BusinessUsers.stopTimerBusiness();
					// BusinessInfoBiz businessInfoBiz = new
					// BusinessInfoBiz(context);
					// businessInfoBiz.clearInfos();
					// }
					// }else{
					// // BusinessUsers.stopTimerCheckIn();
					// BusinessUsers.stopTimerBusiness();
					// TTsFunction.speakText("上班签到成功");
					// BusinessInfoBiz businessInfoBiz = new
					// BusinessInfoBiz(context);
					// businessInfoBiz.clearInfos();
					// }
					// }
					break;
				case 0x0A01:
					// if(result == 0){
					// if(BusinessUsers.isRepost()){
					// if(--BusinessUsers.postCount == 0){
					// BusinessUsers.stopTimerBusiness();
					// BusinessInfoBiz businessInfoBiz = new
					// BusinessInfoBiz(context);
					// businessInfoBiz.clearInfos();
					// }
					// }else{
					// // BusinessUsers.stopTimerCheckOut();
					// BusinessUsers.stopTimerBusiness();
					// TTsFunction.speakText("下班签退成功");
					// BusinessInfoBiz businessInfoBiz = new
					// BusinessInfoBiz(context);
					// businessInfoBiz.clearInfos();
					// }
					// }
					break;
				case 0x0A03:
					// if(result == 0){
					// if(BusinessUsers.isRepost()){
					// if(--BusinessUsers.postCount == 0){
					// BusinessUsers.stopTimerBusiness();
					// BusinessInfoBiz businessInfoBiz = new
					// BusinessInfoBiz(context);
					// businessInfoBiz.clearInfos();
					// }
					// }else{
					// BusinessUsers.stopTimerBusiness();
					// if(Checkstand.instance != null){
					// if(Checkstand.passengerSubmit){
					// TTsFunction.speakText("评价成功");
					// }
					// BusinessInfoBiz businessInfoBiz = new
					// BusinessInfoBiz(context);
					// businessInfoBiz.clearInfos();
					// SerialPortService.handler.postDelayed(new Runnable() {
					//
					// @Override
					// public void run() {
					// // TODO Auto-generated method stub
					// Checkstand.instance.finish();
					// }
					// }, 2000);
					// }
					// }
					// }
					break;
				case 0x0800:
					// NetworkHandler.showToastForCustom("电子服务证请求成功");
					// UploadManager.progress();


					//测试---单帧上传成功
					FloatService.waitUplod = false;
					break;
				case 0x0B05:
					try {
						if(result == 0){
							LocalInfoBiz.getInstance().postBusinessInfoBeforeClear();
						}
					} catch (Exception e) {
						// TODO Auto-generated catch block
						e.printStackTrace();
					}
					break;
				case 0x0B03:
					if(result == 0){
						LocalInfoBiz.getInstance().postCheckInfoBeforeUpdate(LocalInfo.TYPE_CHECK_IN,result);
					}
					break;
				case 0x0B04:
					if(result == 0){
						LocalInfoBiz.getInstance().postCheckInfoBeforeUpdate(LocalInfo.TYPE_CHECK_OUT, 0);
					}
					break;
				case 0x0203:
					if(result == 0){
						LocalInfoBiz.getInstance().postGpsInfosBeforeClear();
					}
					break;
				case 0x01209:
					if (result == 0) {
						TTsFunction.speakText("流媒体注册成功");
					}
					break;
				default:
					break;
			}
		} catch (Exception e) {

			AppLog.e(ExceptionUtil.getInfo(e));
			e.printStackTrace();
		}
	}

	/**
	 * 设置参数设置
	 *
	 * @param paramId
	 *            参数id
	 * @param paramHexValue
	 *            参数值
	 */
	public static void setPreferences(int paramId, String paramHexValue) {
		Log.e("setPreferences",
				"--------------------------------------------------");
		Log.e("setPreferences", Integer.toString(paramId, 16) + "==="
				+ paramHexValue);
		try {
			Log.e("setPreferences", Integer.toString(paramId, 16) + "==="
					+ Integer.parseInt(paramHexValue, 16));
		} catch (Exception e) {
			Log.e("setPreferences", Integer.toString(paramId, 16)
					+ "===超出Int取值范围");
		}
		Log.e("setPreferences",
				Integer.toString(paramId, 16)
						+ "==="
						+ Tools.byteToString(
						Tools.parseHexStr2Byte(paramHexValue), 0,
						paramHexValue.length() / 2));
		Log.e("setPreferences",
				"--------------------------------------------------");
		switch (paramId) {
			case 0x0001: // UINT32 ISU心跳发送间隔，单位为秒（s）
				/**
				 * ----------------------------------------------------------------
				 * ---
				 */
				try {
					int paramValue = Integer.parseInt(paramHexValue, 16);
					DeviceBiz.setHeartTime(paramValue);
				} catch (Exception e) {
					AppLog.e(ExceptionUtil.getInfo(e));
					e.printStackTrace();
				}
				break;

			case 0x0002: // UINT32 TCP消息应答超时时间，单位为秒（s）
				try {
					int paramValue = Integer.parseInt(paramHexValue, 16);
					SPUtils.setParam(SPConstants.PARAMS_TCP_TIME_OUT, paramValue);

				} catch (Exception e) {
					AppLog.e(ExceptionUtil.getInfo(e));
					e.printStackTrace();
				}
				break;
			case 0x0003: // UINT32 TCP消息重传次数
				try {
					int paramValue = Integer.parseInt(paramHexValue, 16);

					SPUtils.setParam(SPConstants.PARAMS_TCP_RESEND_COUNT,
							paramValue);

				} catch (Exception e) {
					AppLog.e(ExceptionUtil.getInfo(e));
					e.printStackTrace();
				}
				break;
			case 0x0004: // UINT32 SMS消息应答超时时间，单位为秒（s）
				try {
					int paramValue = Integer.parseInt(paramHexValue, 16);

					SPUtils.setParam(SPConstants.PARAMS_SMS_TIME_OUT, paramValue);

				} catch (Exception e) {
					AppLog.e(ExceptionUtil.getInfo(e));
					e.printStackTrace();
				}
				break;
			case 0x0005: // UINT32 SMS消息重传次数
				try {
					int paramValue = Integer.parseInt(paramHexValue, 16);

					SPUtils.setParam(SPConstants.PARAMS_SMS_RESEND_COUNT,
							paramValue);

				} catch (Exception e) {
					AppLog.e(ExceptionUtil.getInfo(e));
					e.printStackTrace();
				}
				break;
			case 0x0010: // STRING 主服务器APN，无线通信拨号访问点
				try {

					String hytdapn = Tools.byteToString(
							Tools.parseHexStr2Byte(paramHexValue), 0,
							paramHexValue.length() / 2);
					SPUtils.setParam(SPConstants.PARAMS_SERVER_APN, hytdapn);
					// Log.e("------", "中心服务参数-----"+hytdapn);
				} catch (Exception e) {
					AppLog.e(ExceptionUtil.getInfo(e));
					e.printStackTrace();
				}
				break;
			case 0x0011: // STRING 主服务器无线通信拨号用户名
				try {

					String wirelessusername = Tools.byteToString(
							Tools.parseHexStr2Byte(paramHexValue), 0,
							paramHexValue.length() / 2);
					SPUtils.setParam(SPConstants.PARAMS_MAIN_USER, wirelessusername);

					// Log.e("------", "中心服务参数-----"+wirelessusername);
				} catch (Exception e) {
					AppLog.e(ExceptionUtil.getInfo(e));
					e.printStackTrace();
				}
				break;
			case 0x0012: // STRING 主服务器无线通信拨号密码
				try {

					String value = Tools.byteToString(
							Tools.parseHexStr2Byte(paramHexValue), 0,
							paramHexValue.length() / 2);
					SPUtils.setParam(SPConstants.PARAMS_MAIN_PWD, value);

					// Log.e("------", "中心服务参数-----"+value);
				} catch (Exception e) {
					AppLog.e(ExceptionUtil.getInfo(e));
					e.printStackTrace();
				}
				break;
			case 0x0013: // STRING 主服务器地址,IP或域名
				try {

					byte[] data = Tools.parseHexStr2Byte(paramHexValue);
					String hytdip = Tools.byteToString(data, 0, data.length);
					DeviceBiz.setIp(hytdip);
					AppLog.i("远程升级主服务器IP：" + hytdip);
					DispatchCenterUsers.stopComm(5);
					// Log.e("------", "中心服务参数-----"+hytdip);
				} catch (Exception e) {
					AppLog.e(ExceptionUtil.getInfo(e));
					e.printStackTrace();
				}
				break;
			case 0x0014: // STRING 备份服务器APN，无线通信拨号访问点
				try {

					String hytdapnbak = Tools.byteToString(
							Tools.parseHexStr2Byte(paramHexValue), 0,
							paramHexValue.length() / 2);
					SPUtils.setParam(SPConstants.PARAMS_SERVER_APN_BAK, hytdapnbak);
					// Log.e("------", "中心服务参数-----"+hytdapnbak);
				} catch (Exception e) {
					AppLog.e(ExceptionUtil.getInfo(e));
					e.printStackTrace();
				}
				break;
			case 0x0015: // STRING 备份服务器无线通信拨号用户名
				try {

					String value = Tools.byteToString(
							Tools.parseHexStr2Byte(paramHexValue), 0,
							paramHexValue.length() / 2);
					SPUtils.setParam(SPConstants.WIRELESS_USER_NAME_BAK, value);

					// Log.e("------", "中心服务参数-----"+value);
				} catch (Exception e) {

					AppLog.e(ExceptionUtil.getInfo(e));
					e.printStackTrace();
				}
				break;
			case 0x0016: // STRING 备份服务器无线通信拨号密码
				try {

					String value = Tools.byteToString(
							Tools.parseHexStr2Byte(paramHexValue), 0,
							paramHexValue.length() / 2);
					SPUtils.setParam(SPConstants.WIRELESS_USER_PASSWORD_BAK, value);

					// Log.e("------", "中心服务参数-----"+value);
				} catch (Exception e) {
					AppLog.e(ExceptionUtil.getInfo(e));
					e.printStackTrace();
				}
				break;
			case 0x0017: // STRING 备份服务器地址,IP或域名
				try {

					byte[] data = Tools.parseHexStr2Byte(paramHexValue);
					String hytdipbak = Tools.byteToString(data, 0, data.length);
					DeviceBiz.setIpBak(hytdipbak);
					DispatchCenterUsers.socketManager.setBackupConfigChange(true);
					AppLog.i("远程升级备份服务器IP：" + hytdipbak);
					//DispatchCenterUsers.stopComm(5);
					// Log.e("------", "中心服务参数-----"+hytdipbak);
				} catch (Exception e) {
					AppLog.e(ExceptionUtil.getInfo(e));
					e.printStackTrace();
				}
				break;
			case 0x0018: // UINT32 主服务器TCP端口
				try {

					int hytdport = Integer.parseInt(paramHexValue, 16);
					DeviceBiz.setPort(String.valueOf(hytdport));
					AppLog.i("远程升级主服务器端口：" + hytdport);
					DispatchCenterUsers.stopComm(5);
					// Log.e("------", "中心服务参数-----"+hytdport);
				} catch (Exception e) {
					AppLog.e(ExceptionUtil.getInfo(e));
					e.printStackTrace();
				}
				break;
			case 0x0019: // UINT32 备份服务器TCP端口
				try {

					int hytdportbak = Integer.parseInt(paramHexValue, 16);
					DeviceBiz.setPortBak(String.valueOf(hytdportbak));
					AppLog.i("远程升级备份服务器端口：" + hytdportbak);
					DispatchCenterUsers.socketManager.setBackupConfigChange(true);
					//DispatchCenterUsers.stopComm(5);
					// Log.e("------", "中心服务参数-----"+hytdportbak);
				} catch (Exception e) {
					AppLog.e(ExceptionUtil.getInfo(e));
					e.printStackTrace();
				}
				break;
			case 0x001A: // STRING 一卡通主服务器地址
				try {

					String value = Tools.byteToString(
							Tools.parseHexStr2Byte(paramHexValue), 0,
							paramHexValue.length());
					SPUtils.setParam(SPConstants.ONE_CARD_SERVER_IP, value);

				} catch (Exception e) {
					AppLog.e(ExceptionUtil.getInfo(e));
					e.printStackTrace();
				}
				break;
			case 0x001B: // 一卡通主服务器TCP端口
				try {
					int paramValue = Integer.parseInt(paramHexValue, 16);

					SPUtils.setParam(SPConstants.ONE_CARD_SERVER_IP_PORT,
							paramValue);

				} catch (Exception e) {
					AppLog.e(ExceptionUtil.getInfo(e));
					e.printStackTrace();
				}
				break;
			case 0x001C: // STRING 一卡通备份服务器地址IP或域名
				try {

					String value = Tools.byteToString(
							Tools.parseHexStr2Byte(paramHexValue), 0,
							paramHexValue.length());
					SPUtils.setParam(SPConstants.ONE_CARD_SERVER_IP_BAK, value);

				} catch (Exception e) {
					AppLog.e(ExceptionUtil.getInfo(e));
					e.printStackTrace();
				}
				break;
			case 0x001D: // 一卡通备份服务器TCP端口
				try {
					int paramValue = Integer.parseInt(paramHexValue, 16);

					SPUtils.setParam(SPConstants.ONE_CARD_SERVER_IP_PORT_BAK,
							paramValue);

				} catch (Exception e) {
					AppLog.e(ExceptionUtil.getInfo(e));
					e.printStackTrace();
				}
				break;
			case 0x0020: // UINT32 位置汇报策略，0：定时汇报；1：定距汇报；2：定时 + 定距汇报
				/**
				 * ----------------------------------------------------------------
				 * ---
				 */
				try {
					int paramValue = Integer.parseInt(paramHexValue, 16);

					SPUtils.setParam(SPConstants.PARAMS_POSITION_REPORT_TYPE,
							paramValue);

				} catch (Exception e) {
					AppLog.e(ExceptionUtil.getInfo(e));
					e.printStackTrace();
				}
				break;
			case 0x0021: // UINT32 位置汇报方案，0：根据ACC状态；1：根据空重车状态；2：根据登录状态 +
				// ACC状态，先判断登录状态，若登录再根据ACC状态；3：根据登录状态 +
				// 空重车状态，先判断登录状态，若登录再根据空重车状态
				/**
				 * ----------------------------------------------------------------
				 * ---
				 */
				try {
					int paramValue = Integer.parseInt(paramHexValue, 16);

					SPUtils.setParam(SPConstants.PARAMS_POSITION_REPORT_MODE,
							paramValue);

				} catch (Exception e) {
					AppLog.e(ExceptionUtil.getInfo(e));
					e.printStackTrace();
				}
				break;
			case 0x0022: // UINT32 未登录汇报时间间隔，单位为秒（s）
				try {
					int paramValue = Integer.parseInt(paramHexValue, 16);
					DeviceBiz.setOffLineHeartTime(paramValue);
				} catch (Exception e) {
					AppLog.e(ExceptionUtil.getInfo(e));
					e.printStackTrace();
				}
				break;
			case 0x0023: // UINT32 ACC OFF汇报时间间隔，单位为秒（s）
				try {
					int paramValue = Integer.parseInt(paramHexValue, 16);

					SPUtils.setParam(SPConstants.PARAMS_ACC_OFF_REPORT_TIME,
							paramValue);

				} catch (Exception e) {
					AppLog.e(ExceptionUtil.getInfo(e));
					e.printStackTrace();
				}
				break;
			case 0x0024: // UINT32 ACC ON汇报时间间隔，单位为秒（s）
				try {
					int paramValue = Integer.parseInt(paramHexValue, 16);
					//AppLog.d(TAG,"ltj-------------------paramValue:"+ paramValue + "      " + AppLog.generateTag());
					SPUtils.setParam(SPConstants.PARAMS_ACC_ON_REPORT_TIME,paramValue);
				} catch (Exception e) {
					AppLog.e(ExceptionUtil.getInfo(e));
					e.printStackTrace();
				}
				break;
			case 0x0025: // UINT32 空车汇报时间间隔，单位为秒（s）
				try {
					int paramValue = Integer.parseInt(paramHexValue, 16);
					DeviceBiz.setEmptyCarHeartTime(paramValue);
				} catch (Exception e) {
					AppLog.e(ExceptionUtil.getInfo(e));
					e.printStackTrace();
				}
				break;
			case 0x0026: // UINT32 重车汇报时间间隔，单位为秒（s）
				try {
					int paramValue = Integer.parseInt(paramHexValue, 16);
					DeviceBiz.setFullCarHeartTime(paramValue);
				} catch (Exception e) {

					AppLog.e(TAG);
					e.printStackTrace();
				}
				break;
			case 0x0027: // UINT32 休眠时汇报时间间隔，单位为秒（s）
				try {
					int paramValue = Integer.parseInt(paramHexValue, 16);

					SPUtils.setParam(SPConstants.PARAMS_DORMANT_REPORT_TIME,
							paramValue);

				} catch (Exception e) {
					AppLog.e(ExceptionUtil.getInfo(e));
					e.printStackTrace();
				}
				break;
			case 0x0028: // UINT32 紧急报警时汇报时间间隔，单位为秒（s）
				/**
				 * ----------------------------------------------------------------
				 * ---
				 */
				try {
					int paramValue = Integer.parseInt(paramHexValue, 16);

					SPUtils.setParam(SPConstants.PARAMS_URGENCY_ALARM_REPORT_TIME,
							paramValue);

				} catch (Exception e) {
					AppLog.e(ExceptionUtil.getInfo(e));
					e.printStackTrace();
				}
				break;
			case 0x0029: // UINT32 未登录汇报距离间隔，
				try {
					int paramValue = Integer.parseInt(paramHexValue, 16);

					SPUtils.setParam(SPConstants.PARAMS_OFFLINE_REPORT_DISTANCE,
							paramValue);

				} catch (Exception e) {
					AppLog.e(ExceptionUtil.getInfo(e));
					e.printStackTrace();
				}
				break;
			case 0x002A: // UINT32 ACC OFF汇报距离间隔，单位为米（m）
				try {
					int paramValue = Integer.parseInt(paramHexValue, 16);

					SPUtils.setParam(SPConstants.PARAMS_ACC_OFF_REPORT_DISTANCE,
							paramValue);

				} catch (Exception e) {
					AppLog.e(ExceptionUtil.getInfo(e));
					e.printStackTrace();
				}
				break;
			case 0x002B: // UINT32 ACC ON汇报距离间隔，单位为米（m）
				try {
					int paramValue = Integer.parseInt(paramHexValue, 16);

					SPUtils.setParam(SPConstants.PARAMS_ACC_ON_REPORT_DISTANCE,
							paramValue);

				} catch (Exception e) {
					AppLog.e(ExceptionUtil.getInfo(e));
					e.printStackTrace();
				}
				break;
			case 0x002C: // UINT32 空车汇报距离间隔，单位为米（m）
				try {
					int paramValue = Integer.parseInt(paramHexValue, 16);

					SPUtils.setParam(SPConstants.PARAMS_EMPTY_REPORT_DISTANCE,
							paramValue);

				} catch (Exception e) {
					AppLog.e(ExceptionUtil.getInfo(e));
					e.printStackTrace();
				}
				break;
			case 0x002D: // UINT32 重车汇报距离间隔，单位为米（m）
				try {
					int paramValue = Integer.parseInt(paramHexValue, 16);

					SPUtils.setParam(SPConstants.PARAMS_FULL_REPORT_DISTANCE,
							paramValue);

				} catch (Exception e) {
					AppLog.e(ExceptionUtil.getInfo(e));
					e.printStackTrace();
				}
				break;
			case 0x002E: // UINT32 休眠时汇报距离间隔，单位为米（m）
				try {
					int paramValue = Integer.parseInt(paramHexValue, 16);

					SPUtils.setParam(SPConstants.PARAMS_DORMANT_REPORT_DISTANCE,
							paramValue);

				} catch (Exception e) {
					AppLog.e(ExceptionUtil.getInfo(e));
					e.printStackTrace();
				}
				break;
			case 0x002F: // UINT32 紧急报警时汇报距离间隔，单位为米（m）
				/**
				 * ----------------------------------------------------------------
				 * ---
				 */
				try {
					int paramValue = Integer.parseInt(paramHexValue, 16);

					SPUtils.setParam(
							SPConstants.PARAMS_URGENCY_ALARM_REPORT_DISTANCE,
							paramValue);

				} catch (Exception e) {
					AppLog.e(ExceptionUtil.getInfo(e));
					e.printStackTrace();
				}
				break;
			case 0x0030: // UINT32 拐点补传角度，<180°
				/**
				 * ----------------------------------------------------------------
				 * ---
				 */
				try {
					int paramValue = Integer.parseInt(paramHexValue, 16);

					SPUtils.setParam(SPConstants.PARAMS_FILL_THE_ANGLE, paramValue);

				} catch (Exception e) {
					AppLog.e(ExceptionUtil.getInfo(e));
					e.printStackTrace();
				}
				break;
			case 0x0040: // STRING 监控指挥中心电话号码
				/**
				 * ----------------------------------------------------------------
				 * ---
				 */
				try {
					byte[] data = Tools.parseHexStr2Byte(paramHexValue);
					String paramValue = Tools.byteToString(data, 0, data.length);

					SPUtils.setParam(SPConstants.PARAMS_CENTRA_PHONE, paramValue);

				} catch (Exception e) {
					AppLog.e(ExceptionUtil.getInfo(e));
					e.printStackTrace();
				}
				break;
			case 0x0041: // STRING 复位电话号码
				try {
					byte[] data = Tools.parseHexStr2Byte(paramHexValue);
					String paramValue = Tools.byteToString(data, 0, data.length);

					SPUtils.setParam(SPConstants.PARAMS_RESET_PHONE, paramValue);

				} catch (Exception e) {
					AppLog.e(ExceptionUtil.getInfo(e));
					e.printStackTrace();
				}
				break;
			case 0x0042: // STRING 恢复出厂设置电话号码
				try {
					byte[] data = Tools.parseHexStr2Byte(paramHexValue);
					String paramValue = Tools.byteToString(data, 0, data.length);

					SPUtils.setParam(SPConstants.PARAMS_RESET_FIRST_PHONE,
							paramValue);

				} catch (Exception e) {
					AppLog.e(ExceptionUtil.getInfo(e));
					e.printStackTrace();
				}
				break;
			case 0x0043: // STRING 监控指挥中心SMS电话号码
				try {
					byte[] data = Tools.parseHexStr2Byte(paramHexValue);
					String paramValue = Tools.byteToString(data, 0, data.length);

					SPUtils.setParam(SPConstants.PARAMS_CENTRA_SMS_PHONE,
							paramValue);

				} catch (Exception e) {
					AppLog.e(ExceptionUtil.getInfo(e));
					e.printStackTrace();
				}
				break;
			case 0x0044: // STRING 接收ISUSMS文本报警号码
				try {
					byte[] data = Tools.parseHexStr2Byte(paramHexValue);
					String paramValue = Tools.byteToString(data, 0, data.length);

					SPUtils.setParam(SPConstants.PARAMS_SMS_ALARM_PHONE, paramValue);

				} catch (Exception e) {

					AppLog.e(TAG);
					e.printStackTrace();
				}
				break;
			case 0x0045: // UINT32 ISU电话接听策略：0：自动接听 1：ACC ON时自动接听，OFF时手动接听
				try {
					int paramValue = Integer.parseInt(paramHexValue, 16);

					SPUtils.setParam(SPConstants.PARAMS_ANSWER_CALL_TYPE,
							paramValue);

				} catch (Exception e) {
					AppLog.e(ExceptionUtil.getInfo(e));
					e.printStackTrace();
				}
				break;
			case 0x0046: // UINT32 每次最长通话时间，单位为秒（s）
				try {
					int paramValue = Integer.parseInt(paramHexValue, 16);
					DeviceBiz.setMaxCall(paramValue);
				} catch (Exception e) {
					AppLog.e(ExceptionUtil.getInfo(e));
					e.printStackTrace();
				}
				break;
			case 0x0047: // UINT32 当月最长通话时间，单位为秒（s）
				try {
					int paramValue = Integer.parseInt(paramHexValue, 16);

					SPUtils.setParam(SPConstants.PARAMS_MAX_CALL_MONTH_TIME,
							paramValue);

				} catch (Exception e) {
					AppLog.e(ExceptionUtil.getInfo(e));
					e.printStackTrace();
				}
				break;
			case 0x0048: // 0X0048 UINT32 电话短号长度
				try {
					int paramValue = Integer.parseInt(paramHexValue, 16);

					SPUtils.setParam(SPConstants.PARAMS_SHORT_LENGTH, paramValue);

				} catch (Exception e) {
					AppLog.e(ExceptionUtil.getInfo(e));
					e.printStackTrace();
				}
				break;
			case 0x0049: // STRING 监听电话号码
				try {
					byte[] data = Tools.parseHexStr2Byte(paramHexValue);
					String paramValue = Tools.byteToString(data, 0, data.length);

					SPUtils.setParam(SPConstants.PARAMS_MONITOR_PHONE, paramValue);

				} catch (Exception e) {
					AppLog.e(ExceptionUtil.getInfo(e));
					e.printStackTrace();
				}
				break;
			case 0x004A: // STRING ISU设备维护密码
				/**
				 * ----------------------------------------------------------------
				 * ---
				 */
				try {
					byte[] data = Tools.parseHexStr2Byte(paramHexValue);
					String paramValue = Tools.byteToString(data, 0, data.length);

					SPUtils.setParam(SPConstants.PARAMS_SAFEGUARD_PASSWORD,
							paramValue);

				} catch (Exception e) {
					AppLog.e(ExceptionUtil.getInfo(e));
					e.printStackTrace();
				}
				break;
			case 0x004B: // UINT ISU的语音播报音量控制：0～9 （0为静音，9为最高）
				/**
				 * ----------------------------------------------------------------
				 * ---
				 */
				try {
					int paramValue = Integer.parseInt(paramHexValue, 16);

					SPUtils.setParam(SPConstants.PARAMS_TTS_VOL, paramValue);

				} catch (Exception e) {
					AppLog.e(ExceptionUtil.getInfo(e));
					e.printStackTrace();
				}
				break;
			case 0x0050: // UINT32 报警屏蔽字，与位置信息汇报消息中的报警标志相对应，相应位为1则相应报警被屏蔽
				try {
					int paramValue = Integer.parseInt(paramHexValue, 16);

					SPUtils.setParam(SPConstants.PARAMS_ALARM_FLAG, paramValue);

				} catch (Exception e) {
					AppLog.e(ExceptionUtil.getInfo(e));
					e.printStackTrace();
				}
				break;
			case 0x0051: // UINT32 报警发送文本SMS开关，与位置信息汇报消息中的报警标志相对应，相应位为1则相应报警时发送文本SMS
				try {
					int paramValue = Integer.parseInt(paramHexValue, 16);

					SPUtils.setParam(SPConstants.PARAMS_ALARM_SMS_SWITCHER,
							paramValue);

				} catch (Exception e) {
					AppLog.e(ExceptionUtil.getInfo(e));
					e.printStackTrace();
				}
				break;
			case 0x0052: // UINT32 报警拍摄开关，与位置信息汇报消息中的报警标志相对应，相应位为1则相应报警时摄像头拍摄
				try {
					int paramValue = Integer.parseInt(paramHexValue, 16);

					SPUtils.setParam(SPConstants.PARAMS_ALARM_FILM_SWITCHER,
							paramValue);

				} catch (Exception e) {
					AppLog.e(ExceptionUtil.getInfo(e));
					e.printStackTrace();
				}
				break;
			case 0x0053: // UINT32
				// 报警拍摄存储标志，与位置信息汇报消息中的报警标志相对应，相应位为1则对相应报警时拍的照片进行存储，否则实时上传
				try {
					int paramValue = Integer.parseInt(paramHexValue, 16);

					SPUtils.setParam(SPConstants.PARAMS_ALARM_FILM_SAVE_SWITCHER,
							paramValue);

				} catch (Exception e) {
					AppLog.e(ExceptionUtil.getInfo(e));
					e.printStackTrace();
				}
				break;
			case 0x0055: // UINT32 最高速度，单位为千米每小时（km/h）
				try {
					int paramValue = Integer.parseInt(paramHexValue, 16);

					SPUtils.setParam(SPConstants.PARAMS_MAX_SPEED, paramValue);

				} catch (Exception e) {
					AppLog.e(ExceptionUtil.getInfo(e));
					e.printStackTrace();
				}
				break;
			case 0x0056: // UINT32 超速持续时间，单位为秒（s）
				try {
					int paramValue = Integer.parseInt(paramHexValue, 16);

					SPUtils.setParam(SPConstants.PARAMS_SPEEDING_TIME, paramValue);

				} catch (Exception e) {
					AppLog.e(ExceptionUtil.getInfo(e));
					e.printStackTrace();
				}
				break;
			case 0x0057: // UINT32 连续驾驶时间门限，单位为秒（s）
				try {
					int paramValue = Integer.parseInt(paramHexValue, 16);

					SPUtils.setParam(SPConstants.PARAMS_MAX_RUN_TIME, paramValue);

				} catch (Exception e) {
					AppLog.e(ExceptionUtil.getInfo(e));
					e.printStackTrace();
				}
				break;
			case 0x0058: // DWORD 最小休息时间，单位为秒（s）
				try {
					int paramValue = Integer.parseInt(paramHexValue, 16);

					SPUtils.setParam(SPConstants.PARAMS_MIN_REST_TIME, paramValue);

				} catch (Exception e) {
					AppLog.e(ExceptionUtil.getInfo(e));
					e.printStackTrace();
				}
				break;
			case 0x0059: // DWORD 最小休息时间，单位为秒（s）
				try {
					int paramValue = Integer.parseInt(paramHexValue, 16);

					SPUtils.setParam(SPConstants.PARAMS_MAX_PART_TIME, paramValue);

				} catch (Exception e) {
					AppLog.e(ExceptionUtil.getInfo(e));
					e.printStackTrace();
				}
				break;
			case 0x005A: // DWORD 最长停车时间，单位为秒（s）
				try {
					int paramValue = Integer.parseInt(paramHexValue, 16);

					SPUtils.setParam(SPConstants.PARAMS_MAX_DAILY_RUN_TIME,
							paramValue);

				} catch (Exception e) {
					AppLog.e(ExceptionUtil.getInfo(e));
					e.printStackTrace();
				}
				break;
			/*
			 * case 0x005B: // WORD 事件触发拍照控制，参见附录D try { int paramValue =
			 * Integer.parseInt(paramHexValue, 16);
			 *
			 * SPUtils.setParam(SPConstants.PARAMS_PHOTOGRAPH_TRIGGER, paramValue);
			 *
			 * } catch (Exception e) { AppLog.e(ExceptionUtil.getInfo(e));
			 * e.printStackTrace(); } break; case 0x005C: // WORD 拍照存储控制，参见表附录D try
			 * { int paramValue = Integer.parseInt(paramHexValue, 16);
			 *
			 * SPUtils.setParam(SPConstants.PARAMS_PICTRUE_SAVE, paramValue);
			 *
			 * } catch (Exception e) { AppLog.e(ExceptionUtil.getInfo(e));
			 * e.printStackTrace(); } break;
			 */
			case 0x0070: // UINT32 图像/视频质量，1～10，1最好
				try {
					int paramValue = Integer.parseInt(paramHexValue, 16);

					SPUtils.setParam(SPConstants.PARAMS_VEDIO_LEVEL, paramValue);

				} catch (Exception e) {
					AppLog.e(ExceptionUtil.getInfo(e));
					e.printStackTrace();
				}
				break;
			case 0x0071: // UINT32 亮度，0～255
				try {
					final int paramValue = Integer.parseInt(paramHexValue, 16);

					SPUtils.setParam(SPConstants.PARAMS_BRIGHTNESS, paramValue);
					//注意先保存亮度设置,再设置屏幕亮度才有作用
					CarCallSystemBiz.saveScreenBrightness(MainApplication.topActivity, paramValue);
					MainApplication.handler.post(new Runnable() {
						@Override
						public void run() {
							CarCallSystemBiz.setScreenBrightness(MainApplication.topActivity, paramValue);
						}
					});
				} catch (Exception e) {
					AppLog.e(ExceptionUtil.getInfo(e));
					e.printStackTrace();
				}
				break;
			case 0x0072: // UINT32 对比度，0～127
				try {
					int paramValue = Integer.parseInt(paramHexValue, 16);

					SPUtils.setParam(SPConstants.PARAMS_CONTRAST, paramValue);

				} catch (Exception e) {
					AppLog.e(ExceptionUtil.getInfo(e));
					e.printStackTrace();
				}
				break;
			case 0x0073: // UINT32 饱和度，0～127
				try {
					int paramValue = Integer.parseInt(paramHexValue, 16);

					SPUtils.setParam(SPConstants.PARAMS_SATURABILITY, paramValue);
				} catch (Exception e) {
					AppLog.e(ExceptionUtil.getInfo(e));
					e.printStackTrace();
				}
				break;
			case 0x0074: // UINT32 色度，0～255
				try {
					int paramValue = Integer.parseInt(paramHexValue, 16);

					SPUtils.setParam(SPConstants.PARAMS_CHROMINANCE, paramValue);

				} catch (Exception e) {
					AppLog.e(ExceptionUtil.getInfo(e));
					e.printStackTrace();
				}
				break;
			case 0x0075: //拍照照片存储策略
				try {
					int paramValue = Integer.parseInt(paramHexValue, 16);
					SPUtils.setParam(SPConstants.PHOTOGRAPH_TAKE_STORAGE,paramValue);
				} catch (Exception e) {
					AppLog.e(ExceptionUtil.getInfo(e));
					e.printStackTrace();
				}
				break;
			case 0x0076: //拍照照片上传策略
				try {
					int paramValue = Integer.parseInt(paramHexValue, 16);
					SPUtils.setParam(SPConstants.PHOTOGRAPH_TAKE_UPLOAD,paramValue);
				} catch (Exception e) {
					AppLog.e(ExceptionUtil.getInfo(e));
					e.printStackTrace();
				}
				break;
			case 0x0077: //定时拍照:0不开;1全程打开;2重车状态//add by undi 2019-08-26
				try {
					int paramValue = Integer.parseInt(paramHexValue, 16);
					SPUtils.setParam(SPConstants.PHOTOGRAPH_TAKE_TYPE,paramValue);
					photographTask.setPhotographTakeType(paramValue);
				} catch (Exception e) {
					AppLog.e(ExceptionUtil.getInfo(e));
					e.printStackTrace();
				}
				break;
			case 0x0078: //定时拍照间隔时间
				try {
					int paramValue = Integer.parseInt(paramHexValue, 16);
					if(paramValue < 5){
						paramValue = 5;
					}
					SPUtils.setParam(SPConstants.PHOTOGRAPH_INTERVAL_TIME, paramValue);
					photographTask.setTimeInterval(paramValue);
				} catch (Exception e) {
					AppLog.e(ExceptionUtil.getInfo(e));
					e.printStackTrace();
				}
				break;
			case 0x0079: //定时拍照分辨率
				try {
					int paramValue = Integer.parseInt(paramHexValue, 16);
					SPUtils.setParam(SPConstants.PHOTOGRAPH_QUALITY_TYPE, paramValue);
					photographTask.setPhotographQualityType(paramValue);
				} catch (Exception e) {
					AppLog.e(ExceptionUtil.getInfo(e));
					e.printStackTrace();
				}
				break;
			case 0x007A: //报警时拍照的照片数量（内外均拍）。
				try {
					int paramValue = Integer.parseInt(paramHexValue, 16);
					SPUtils.setParam(SPConstants.PHOTOGRAPH_ALARM_TOTAL, paramValue);
				} catch (Exception e) {
					AppLog.e(ExceptionUtil.getInfo(e));
					e.printStackTrace();
				}
				break;
			case 0x007B: //报警时拍照时间间隔，单位s
				try {
					int paramValue = Integer.parseInt(paramHexValue, 16);
					SPUtils.setParam(SPConstants.PHOTOGRAPH_TAKE_ALARM_TIME, paramValue);
				} catch (Exception e) {
					AppLog.e(ExceptionUtil.getInfo(e));
					e.printStackTrace();
				}
				break;
			case 0x0080: // UINT32 车辆里程表读数，0.1km
				try {
					int paramValue = Integer.parseInt(paramHexValue, 16);

					SPUtils.setParam(SPConstants.PARAMS_ODOMETER_READING,
							paramValue);

				} catch (Exception e) {
					AppLog.e(ExceptionUtil.getInfo(e));
					e.printStackTrace();
				}
				break;
			case 0x0081: // UINT32 车辆所在的省域ID，1～255
				try {
					int paramValue = Integer.parseInt(paramHexValue, 16);

					SPUtils.setParam(SPConstants.PARAMS_CURRENT_PROVINCE,
							paramValue);

				} catch (Exception e) {
					AppLog.e(ExceptionUtil.getInfo(e));
					e.printStackTrace();
				}
				break;
			case 0x0082: // UINT32 车辆所在的市域ID，1～255
				try {
					int paramValue = Integer.parseInt(paramHexValue, 16);

					SPUtils.setParam(SPConstants.PARAMS_CURRENT_CITY, paramValue);

				} catch (Exception e) {
					AppLog.e(ExceptionUtil.getInfo(e));
					e.printStackTrace();
				}
				break;
			case 0x0090: // BCD[1] 计价器营运次数限制，0～9999；0表示不做限制
				try {
					SPUtils.setParam(SPConstants.PARAMS_METER_USEABLE_COUNT,paramHexValue);
					MeterDecoder.meterConfigTask.setNeedUpdate(true);
				} catch (Exception e) {
					AppLog.e(ExceptionUtil.getInfo(e));
					e.printStackTrace();
				}
				break;
			case 0x0091: // BCD[5] 计价器营运时间限制，YYYYMMDDHH，0000000000表示不做限制
				try {
					SPUtils.setParam(SPConstants.PARAMS_METER_USEABLE_TIME, paramHexValue);
					MeterDecoder.meterConfigTask.setNeedUpdate(true);
				} catch (Exception e) {
					AppLog.e(ExceptionUtil.getInfo(e));
					e.printStackTrace();
				}
				break;

			case 0x0092: // STRING 企业编码
				try {
					String paramValue = Tools.bcd2Str(Tools
							.parseHexStr2Byte(paramHexValue));

					SPUtils.setParam(SPConstants.COMPANY_CODE, paramValue);

				} catch (Exception e) {
					AppLog.e(ExceptionUtil.getInfo(e));
					e.printStackTrace();
				}
				break;

			case 0x0093: // STRING 企业简称
				try {
					String paramValue = Tools.bcd2Str(Tools
							.parseHexStr2Byte(paramHexValue));

					SPUtils.setParam(SPConstants.COMPANY_NAME, paramValue);

				} catch (Exception e) {
					AppLog.e(ExceptionUtil.getInfo(e));
					e.printStackTrace();
				}
				break;

			case 0x0094: // ASCII[6] 车牌号码(不包括汉字)
				try {
					//西安平台是GBK编码
					//String paramValue = Tools.bcd2Str(Tools.parseHexStr2Byte(paramHexValue));
					String paramValue = Tools.byteToString(Tools.parseHexStr2Byte(paramHexValue), 0,paramHexValue.length() / 2);
					DeviceBiz.setCarNumber(paramValue);
					DeviceBiz.setCarNumberCorrection(false);
				} catch (Exception e) {
					AppLog.e(ExceptionUtil.getInfo(e));
					e.printStackTrace();
				}
				break;

			case 0x00A0: // 智能终端录音模式（OXOh全程录音;0X02:翻牌录音)
				try {
					int paramValue = Integer.parseInt(paramHexValue, 16);
					RecorderBiz.setRecordType(paramValue);
				} catch (Exception e) {
					AppLog.e(ExceptionUtil.getInfo(e));
					e.printStackTrace();
				}
				break;
			case 0x00A1: // UINT8 智能终端录音文件最大时长（1-255)分钟
				try {
					int paramValue = Integer.parseInt(paramHexValue, 16);
					RecorderBiz.setMaxTime(paramValue);
				} catch (Exception e) {
					AppLog.e(ExceptionUtil.getInfo(e));
					e.printStackTrace();
				}
				break;
			case 0x00A2: // UINT8 液晶（LCD）心跳时间间隔，1～60，单位为秒（s）
				try {
					int paramValue = Integer.parseInt(paramHexValue, 16);

					SPUtils.setParam(SPConstants.PARAMS_LCD_HEARTBEAT_TIME,
							paramValue);

				} catch (Exception e) {
					AppLog.e(ExceptionUtil.getInfo(e));
					e.printStackTrace();
				}
				break;
			case 0x00A3: // UINT8 LED心跳时间间隔，单位为秒（s）
				try {
					int paramValue = Integer.parseInt(paramHexValue, 16);

					SPUtils.setParam(SPConstants.PARAMS_LED_HEARTBEAT_TIME,
							paramValue);

				} catch (Exception e) {
					AppLog.e(ExceptionUtil.getInfo(e));
					e.printStackTrace();
				}
				break;
			case 0x00AF: // UINT16 ACC OFF后进入休眠模式的时间，单位为秒（s）
				try {
					int paramValue = Integer.parseInt(paramHexValue, 16);

					SPUtils.setParam(SPConstants.PARAMS_ACC_OFF_DORMANT_TIME,
							paramValue);

				} catch (Exception e) {
					AppLog.e(ExceptionUtil.getInfo(e));
					e.printStackTrace();
				}
				break;
			case 0x00B0: // UINT8 视频服务器协议模式 0x00：TCP；0x01：UDP
				try {
					int paramValue = Integer.parseInt(paramHexValue, 16);

					SPUtils.setParam(SPConstants.PARAMS_VEDIO_PROTOCOL_MODE,
							paramValue);

				} catch (Exception e) {
					AppLog.e(ExceptionUtil.getInfo(e));
					e.printStackTrace();
				}
				break;
			case 0x00B1: // STRING 视频服务器APN，无线通信拨号访问点
				try {
					byte[] data = Tools.parseHexStr2Byte(paramHexValue);
					String paramValue = Tools.byteToString(data, 0, data.length);

					SPUtils.setParam(SPConstants.PARAMS_VEDIO_ADDR, paramValue);

				} catch (Exception e) {
					AppLog.e(ExceptionUtil.getInfo(e));
					e.printStackTrace();
				}
				break;
			case 0x00B2: // STRING 视频服务器无线通信拨号用户名
				try {
					byte[] data = Tools.parseHexStr2Byte(paramHexValue);
					String paramValue = Tools.byteToString(data, 0, data.length);

					SPUtils.setParam(SPConstants.PARAMS_VEDIO_USER_NAME, paramValue);

				} catch (Exception e) {
					AppLog.e(ExceptionUtil.getInfo(e));
					e.printStackTrace();
				}
				break;
			case 0x00B3: // STRING 视频服务器无线通信拨号密码
				try {
					byte[] data = Tools.parseHexStr2Byte(paramHexValue);
					String paramValue = Tools.byteToString(data, 0, data.length);

					SPUtils.setParam(SPConstants.PARAMS_VEDIO_USER_PASSWORD,
							paramValue);

				} catch (Exception e) {
					AppLog.e(ExceptionUtil.getInfo(e));
					e.printStackTrace();
				}
				break;
			case 0x00B4: // STRING 视频服务器地址,IP或域名
				try {
					byte[] data = Tools.parseHexStr2Byte(paramHexValue);
					String paramValue = Tools.byteToString(data, 0, data.length);

					SPUtils.setParam(SPConstants.PARAMS_VEDIO_IP, paramValue);

				} catch (Exception e) {
					AppLog.e(ExceptionUtil.getInfo(e));
					e.printStackTrace();
				}
				break;
			case 0x00B5: // UINT32 视频服务器端口
				try {
					int paramValue = Integer.parseInt(paramHexValue, 16);

					SPUtils.setParam(SPConstants.PARAMS_VEDIO_PORT, paramValue);

				} catch (Exception e) {
					AppLog.e(ExceptionUtil.getInfo(e));
					e.printStackTrace();
				}
				break;

			default:
				break;
		}
	}

	/**
	 * 查询参数设置
	 *
	 * @param paramId
	 *            参数id
	 */
	private synchronized static byte[] getPreference(int paramId) {
		// TODO Auto-generated method stub
		/*
		 * if(paramId != 0x0023 && paramId != 0x0025 && paramId != 0x0026 &&
		 * paramId != 0x0046 && paramId != 0x0028 && paramId != 0x0013 &&
		 * paramId != 0x0017 && paramId != 0x0018 && paramId != 0x0019 &&
		 * paramId != 0x0030 && paramId != 0x0022 && paramId != 0x00A2 &&
		 * paramId != 0x0056 && paramId != 0x0049){ return null; }
		 */
		byte[] data = null;
		int dstPos = 0;
		switch (paramId) {
			case 0x0001: // UINT32 ISU心跳发送间隔，单位为秒（s）
				try {
					int paramValue = DeviceBiz.getHeartTime();
					data = new byte[3 + 4];
					// 参数ID UINT16
					System.arraycopy(Tools.sortToByte(Tools.int2Bytes(paramId, 2)),
							0, data, dstPos, 2);
					dstPos += 2;
					// 参数长度 UINT8
					System.arraycopy(Tools.sortToByte(Tools.int2Bytes(4, 1)), 0,
							data, dstPos, 1);
					dstPos += 1;
					// 参数
					System.arraycopy(
							Tools.sortToByte(Tools.int2Bytes(paramValue, 4)), 0,
							data, dstPos, 4);
				} catch (Exception e) {
					AppLog.e(ExceptionUtil.getInfo(e));
					e.printStackTrace();
				}
				break;
			case 0x0002: // UINT32 TCP消息应答超时时间，单位为秒（s）
				try {
					int paramValue = SPUtils.getParamInteger(
							SPConstants.PARAMS_TCP_TIME_OUT, 10);
					data = new byte[3 + 4];
					// 参数ID UINT16
					System.arraycopy(Tools.sortToByte(Tools.int2Bytes(paramId, 2)),
							0, data, dstPos, 2);
					dstPos += 2;
					// 参数长度 UINT8
					System.arraycopy(Tools.sortToByte(Tools.int2Bytes(4, 1)), 0,
							data, dstPos, 1);
					dstPos += 1;
					// 参数
					System.arraycopy(
							Tools.sortToByte(Tools.int2Bytes(paramValue, 4)), 0,
							data, dstPos, 4);
				} catch (Exception e) {
					AppLog.e(ExceptionUtil.getInfo(e));
					e.printStackTrace();
				}
				break;
			case 0x0003: // UINT32 TCP消息重传次数
				try {
					int paramValue = SPUtils.getParamInteger(
							SPConstants.PARAMS_TCP_RESEND_COUNT, 3);
					data = new byte[3 + 4];
					// 参数ID UINT16
					System.arraycopy(Tools.sortToByte(Tools.int2Bytes(paramId, 2)),
							0, data, dstPos, 2);
					dstPos += 2;
					// 参数长度 UINT8
					System.arraycopy(Tools.sortToByte(Tools.int2Bytes(4, 1)), 0,
							data, dstPos, 1);
					dstPos += 1;
					// 参数
					System.arraycopy(
							Tools.sortToByte(Tools.int2Bytes(paramValue, 4)), 0,
							data, dstPos, 4);
				} catch (Exception e) {
					AppLog.e(ExceptionUtil.getInfo(e));
					e.printStackTrace();
				}
				break;

			case 0x0004:	// UINT32 SMS消息应答超时时间，单位为秒（s）
				try {
					int paramValue = SPUtils.defaultPref().getInt(SPConstants.PARAMS_SMS_TIME_OUT, 10);
					data = new byte[3+4];
					// 参数ID	UINT16
					System.arraycopy(Tools.sortToByte(Tools.int2Bytes(paramId,2)), 0, data, dstPos, 2);
					dstPos+=2;
					// 参数长度	UINT8
					System.arraycopy(Tools.sortToByte(Tools.int2Bytes(4,1)), 0, data, dstPos, 1);
					dstPos+=1;
					//参数
					System.arraycopy(Tools.sortToByte(Tools.int2Bytes(paramValue,4)), 0, data, dstPos, 4);
				} catch (Exception e) {
					AppLog.e(ExceptionUtil.getInfo(e), e);
					e.printStackTrace();
				}
				break;
			case 0x0005:	// UINT32 SMS消息重传次数
				try {
					int paramValue = SPUtils.defaultPref().getInt(SPConstants.PARAMS_SMS_RESEND_COUNT, 3);
					data = new byte[3+4];
					// 参数ID	UINT16
					System.arraycopy(Tools.sortToByte(Tools.int2Bytes(paramId,2)), 0, data, dstPos, 2);
					dstPos+=2;
					// 参数长度	UINT8
					System.arraycopy(Tools.sortToByte(Tools.int2Bytes(4,1)), 0, data, dstPos, 1);
					dstPos+=1;
					//参数
					System.arraycopy(Tools.sortToByte(Tools.int2Bytes(paramValue,4)), 0, data, dstPos, 4);
				} catch (Exception e) {
					AppLog.e(ExceptionUtil.getInfo(e), e);
					e.printStackTrace();
				}
				break;
			case 0x0010: // STRING 主服务器APN，无线通信拨号访问点
				try {
					String paramValue = SPUtils.getParamString(
							SPConstants.PARAMS_SERVER_APN, "");
					byte[] paramValueByte = (paramValue + "\0").getBytes("GBK");
					data = new byte[3 + paramValueByte.length];
					// 参数ID UINT16
					System.arraycopy(Tools.sortToByte(Tools.int2Bytes(paramId, 2)),
							0, data, dstPos, 2);
					dstPos += 2;
					// 参数长度 UINT8
					System.arraycopy(Tools.sortToByte(Tools.int2Bytes(
							paramValueByte.length, 1)), 0, data, dstPos, 1);
					dstPos += 1;
					// 参数
					System.arraycopy(paramValueByte, 0, data, dstPos,
							paramValueByte.length);
				} catch (Exception e) {
					AppLog.e(ExceptionUtil.getInfo(e));
					e.printStackTrace();
				}
				break;
			case 0x0011: // 0X0011 STRING 主服务器无线通信拨号用户名
				try {
					String paramValue = SPUtils.getParamString(
							SPConstants.PARAMS_MAIN_USER, "");
					byte[] paramValueByte = (paramValue + "\0").getBytes("GBK");
					data = new byte[3 + paramValueByte.length];
					// 参数ID UINT16
					System.arraycopy(Tools.sortToByte(Tools.int2Bytes(paramId, 2)),
							0, data, dstPos, 2);
					dstPos += 2;
					// 参数长度 UINT8
					System.arraycopy(Tools.sortToByte(Tools.int2Bytes(
							paramValueByte.length, 1)), 0, data, dstPos, 1);
					dstPos += 1;
					// 参数
					System.arraycopy(paramValueByte, 0, data, dstPos,
							paramValueByte.length);
				} catch (Exception e) {
					AppLog.e(ExceptionUtil.getInfo(e));
					e.printStackTrace();
				}
				break;
			case 0x0012: // 0x0012 STRING 主服务器无线通信拨号密码
				try {
					String paramValue = SPUtils.getParamString(
							SPConstants.PARAMS_MAIN_PWD, "");
					byte[] paramValueByte = (paramValue + "\0").getBytes("GBK");
					data = new byte[3 + paramValueByte.length];
					// 参数ID UINT16
					System.arraycopy(Tools.sortToByte(Tools.int2Bytes(paramId, 2)),
							0, data, dstPos, 2);
					dstPos += 2;
					// 参数长度 UINT8
					System.arraycopy(Tools.sortToByte(Tools.int2Bytes(
							paramValueByte.length, 1)), 0, data, dstPos, 1);
					dstPos += 1;
					// 参数
					System.arraycopy(paramValueByte, 0, data, dstPos,
							paramValueByte.length);
				} catch (Exception e) {
					AppLog.e(ExceptionUtil.getInfo(e));
					e.printStackTrace();
				}
				break;
			case 0x0013: // STRING 主服务器地址,IP或域名
				try {
					String paramValue = DeviceBiz.getIp();
					byte[] paramValueByte = (paramValue + "\0").getBytes("GBK");
					data = new byte[3 + paramValueByte.length];
					// 参数ID UINT16
					System.arraycopy(Tools.sortToByte(Tools.int2Bytes(paramId, 2)),
							0, data, dstPos, 2);
					dstPos += 2;
					// 参数长度 UINT8
					System.arraycopy(Tools.sortToByte(Tools.int2Bytes(
							paramValueByte.length, 1)), 0, data, dstPos, 1);
					dstPos += 1;
					// 参数
					System.arraycopy(paramValueByte, 0, data, dstPos,
							paramValueByte.length);
				} catch (Exception e) {
					AppLog.e(ExceptionUtil.getInfo(e));
					e.printStackTrace();
				}
				break;
			case 0x0014: // STRING 备份服务器APN，无线通信拨号访问点
				try {
					String paramValue = SPUtils.getParamString(
							SPConstants.PARAMS_SERVER_APN_BAK, "");
					byte[] paramValueByte = (paramValue + "\0").getBytes("GBK");
					data = new byte[3 + paramValueByte.length];
					// 参数ID UINT16
					System.arraycopy(Tools.sortToByte(Tools.int2Bytes(paramId, 2)),
							0, data, dstPos, 2);
					dstPos += 2;
					// 参数长度 UINT8
					System.arraycopy(Tools.sortToByte(Tools.int2Bytes(
							paramValueByte.length, 1)), 0, data, dstPos, 1);
					dstPos += 1;
					// 参数
					System.arraycopy(paramValueByte, 0, data, dstPos,
							paramValueByte.length);
				} catch (Exception e) {
					AppLog.e(ExceptionUtil.getInfo(e));
					e.printStackTrace();
				}
				break;
			case 0x0015:	// 0X0015	STRING	副服务器无线通信拨号用户名
				try {
					String paramValue = SPUtils.defaultPref().getString(SPConstants.WIRELESS_USER_NAME_BAK, "");
					byte[] paramValueByte = (paramValue).getBytes("GBK");
					data = new byte[3+paramValueByte.length];
					// 参数ID	UINT16
					System.arraycopy(Tools.sortToByte(Tools.int2Bytes(paramId,2)), 0, data, dstPos, 2);
					dstPos+=2;
					// 参数长度	UINT8
					System.arraycopy(Tools.sortToByte(Tools.int2Bytes(paramValueByte.length,1)), 0, data, dstPos, 1);
					dstPos+=1;
					//参数
					System.arraycopy(paramValueByte, 0, data, dstPos, paramValueByte.length);
				} catch (Exception e) {
					AppLog.e(ExceptionUtil.getInfo(e), e);
					e.printStackTrace();
				}
				break;
			case 0x0016:	// 0x0016	STRING	副服务器无线通信拨号密码
				try {
					String paramValue = SPUtils.defaultPref().getString(SPConstants.WIRELESS_USER_PASSWORD_BAK, "");
					byte[] paramValueByte = (paramValue).getBytes("GBK");
					data = new byte[3+paramValueByte.length];
					// 参数ID	UINT16
					System.arraycopy(Tools.sortToByte(Tools.int2Bytes(paramId,2)), 0, data, dstPos, 2);
					dstPos+=2;
					// 参数长度	UINT8
					System.arraycopy(Tools.sortToByte(Tools.int2Bytes(paramValueByte.length,1)), 0, data, dstPos, 1);
					dstPos+=1;
					//参数
					System.arraycopy(paramValueByte, 0, data, dstPos, paramValueByte.length);
				} catch (Exception e) {
					AppLog.e(ExceptionUtil.getInfo(e), e);
					e.printStackTrace();
				}
				break;
			case 0x0017: // STRING 备份服务器地址,IP或域名
				try {
					String paramValue = DeviceBiz.getIpBak();
					byte[] paramValueByte = (paramValue + "\0").getBytes("GBK");
					data = new byte[3 + paramValueByte.length];
					// 参数ID UINT16
					System.arraycopy(Tools.sortToByte(Tools.int2Bytes(paramId, 2)),
							0, data, dstPos, 2);
					dstPos += 2;
					// 参数长度 UINT8
					System.arraycopy(Tools.sortToByte(Tools.int2Bytes(
							paramValueByte.length, 1)), 0, data, dstPos, 1);
					dstPos += 1;
					// 参数
					System.arraycopy(paramValueByte, 0, data, dstPos,
							paramValueByte.length);
				} catch (Exception e) {
					AppLog.e(ExceptionUtil.getInfo(e));
					e.printStackTrace();
				}
				break;
			case 0x0018: // UINT32 主服务器TCP端口
				try {
					String port = DeviceBiz.getPort();
					int paramValue = 0;
					if(!StringUtil.isNull(port)){
						paramValue = Integer.parseInt(port);
					}
					data = new byte[3 + 4];
					// 参数ID UINT16
					System.arraycopy(Tools.sortToByte(Tools.int2Bytes(paramId, 2)),
							0, data, dstPos, 2);
					dstPos += 2;
					// 参数长度 UINT8
					System.arraycopy(Tools.sortToByte(Tools.int2Bytes(4, 1)), 0,
							data, dstPos, 1);
					dstPos += 1;
					// 参数
					System.arraycopy(
							Tools.sortToByte(Tools.int2Bytes(paramValue, 4)), 0,
							data, dstPos, 4);
				} catch (Exception e) {
					AppLog.e(ExceptionUtil.getInfo(e));
					e.printStackTrace();
				}
				break;
			case 0x0019: // UINT32 备份服务器TCP端口
				try {
					String port = DeviceBiz.getPortBak();
					int paramValue = 0;
					if(!StringUtil.isNull(port)){
						paramValue = Integer.parseInt(port);
					}
					data = new byte[3 + 4];
					// 参数ID UINT16
					System.arraycopy(Tools.sortToByte(Tools.int2Bytes(paramId, 2)),
							0, data, dstPos, 2);
					dstPos += 2;
					// 参数长度 UINT8
					System.arraycopy(Tools.sortToByte(Tools.int2Bytes(4, 1)), 0,
							data, dstPos, 1);
					dstPos += 1;
					// 参数
					System.arraycopy(
							Tools.sortToByte(Tools.int2Bytes(paramValue, 4)), 0,
							data, dstPos, 4);
				} catch (Exception e) {
					AppLog.e(ExceptionUtil.getInfo(e));
					e.printStackTrace();
				}
				break;
			case 0x001A:	// 0x001A	STRING	一卡通或支付平台主服务器地址,IP或域名
				try {
					String paramValue = SPUtils.defaultPref().getString(SPConstants.ONE_CARD_SERVER_IP, "");
					byte[] paramValueByte = (paramValue).getBytes("GBK");
					data = new byte[3+paramValueByte.length];
					// 参数ID	UINT16
					System.arraycopy(Tools.sortToByte(Tools.int2Bytes(paramId,2)), 0, data, dstPos, 2);
					dstPos+=2;
					// 参数长度	UINT8
					System.arraycopy(Tools.sortToByte(Tools.int2Bytes(paramValueByte.length,1)), 0, data, dstPos, 1);
					dstPos+=1;
					//参数
					System.arraycopy(paramValueByte, 0, data, dstPos, paramValueByte.length);
				} catch (Exception e) {
					AppLog.e(ExceptionUtil.getInfo(e), e);
					e.printStackTrace();
				}
				break;
			case 0x001B:	// UINT32	备份服务器UCP端口
				try {
					int paramValue = SPUtils.defaultPref().getInt(SPConstants.ONE_CARD_SERVER_IP_PORT, 0);
					data = new byte[3+4];
					// 参数ID	UINT16
					System.arraycopy(Tools.sortToByte(Tools.int2Bytes(paramId,2)), 0, data, dstPos, 2);
					dstPos+=2;
					// 参数长度	UINT8
					System.arraycopy(Tools.sortToByte(Tools.int2Bytes(4,1)), 0, data, dstPos, 1);
					dstPos+=1;
					//参数
					System.arraycopy(Tools.sortToByte(Tools.int2Bytes(paramValue,4)), 0, data, dstPos, 4);
				} catch (Exception e) {
					AppLog.e(ExceptionUtil.getInfo(e), e);
					e.printStackTrace();
				}
				break;
			case 0x001C:	// 0x001C	STRING	一卡通备份服务器地址IP或域名
				try {
					String paramValue = SPUtils.defaultPref().getString(SPConstants.ONE_CARD_SERVER_IP_BAK, "");
					byte[] paramValueByte = (paramValue).getBytes("GBK");
					data = new byte[3+paramValueByte.length];
					// 参数ID	UINT16
					System.arraycopy(Tools.sortToByte(Tools.int2Bytes(paramId,2)), 0, data, dstPos, 2);
					dstPos+=2;
					// 参数长度	UINT8
					System.arraycopy(Tools.sortToByte(Tools.int2Bytes(paramValueByte.length,1)), 0, data, dstPos, 1);
					dstPos+=1;
					//参数
					System.arraycopy(paramValueByte, 0, data, dstPos, paramValueByte.length);
				} catch (Exception e) {
					AppLog.e(ExceptionUtil.getInfo(e), e);
					e.printStackTrace();
				}
				break;
			case 0x001D:	// UINT32	一卡通或支付平台备份服务器TCP端口
				try {
					int paramValue = SPUtils.defaultPref().getInt(SPConstants.ONE_CARD_SERVER_IP_PORT_BAK, 0);
					data = new byte[3+4];
					// 参数ID	UINT16
					System.arraycopy(Tools.sortToByte(Tools.int2Bytes(paramId,2)), 0, data, dstPos, 2);
					dstPos+=2;
					// 参数长度	UINT8
					System.arraycopy(Tools.sortToByte(Tools.int2Bytes(4,1)), 0, data, dstPos, 1);
					dstPos+=1;
					//参数
					System.arraycopy(Tools.sortToByte(Tools.int2Bytes(paramValue,4)), 0, data, dstPos, 4);
				} catch (Exception e) {
					AppLog.e(ExceptionUtil.getInfo(e), e);
					e.printStackTrace();
				}
				break;
			case 0x0020: // UINT32 位置汇报策略，0：定时汇报；1：定距汇报；2：定时 + 定距汇报
				try {
					int paramValue = SPUtils.getParamInteger(
							SPConstants.PARAMS_POSITION_REPORT_TYPE, 0);
					data = new byte[3 + 4];
					// 参数ID UINT16
					System.arraycopy(Tools.sortToByte(Tools.int2Bytes(paramId, 2)),
							0, data, dstPos, 2);
					dstPos += 2;
					// 参数长度 UINT8
					System.arraycopy(Tools.sortToByte(Tools.int2Bytes(4, 1)), 0,
							data, dstPos, 1);
					dstPos += 1;
					// 参数
					System.arraycopy(
							Tools.sortToByte(Tools.int2Bytes(paramValue, 4)), 0,
							data, dstPos, 4);
				} catch (Exception e) {
					AppLog.e(ExceptionUtil.getInfo(e));
					e.printStackTrace();
				}
				break;
			case 0x0021:	// UINT32	位置汇报方案，0：根据ACC状态；1：根据空重车状态；2：根据登录状态 + ACC状态，先判断登录状态，若登录再根据ACC状态；3：根据登录状态 + 空重车状态，先判断登录状态，若登录再根据空重车状态
				try {
					int paramValue = SPUtils.getParamInteger(
							SPConstants.PARAMS_POSITION_REPORT_MODE, 3);
					data = new byte[3+4];
					// 参数ID	UINT16
					System.arraycopy(Tools.sortToByte(Tools.int2Bytes(paramId,2)), 0, data, dstPos, 2);
					dstPos+=2;
					// 参数长度	UINT8
					System.arraycopy(Tools.sortToByte(Tools.int2Bytes(4,1)), 0, data, dstPos, 1);
					dstPos+=1;
					//参数
					System.arraycopy(Tools.sortToByte(Tools.int2Bytes(paramValue,4)), 0, data, dstPos, 4);
				} catch (Exception e) {
					AppLog.e(ExceptionUtil.getInfo(e), e);
					e.printStackTrace();
				}
				break;
			case 0x0022: // UINT32 未登录汇报时间间隔，单位为秒（s）
				try {
					int paramValue = DeviceBiz.getOffLineHeartTime();
					data = new byte[3 + 4];
					// 参数ID UINT16
					System.arraycopy(Tools.sortToByte(Tools.int2Bytes(paramId, 2)),
							0, data, dstPos, 2);
					dstPos += 2;
					// 参数长度 UINT8
					System.arraycopy(Tools.sortToByte(Tools.int2Bytes(4, 1)), 0,
							data, dstPos, 1);
					dstPos += 1;
					// 参数
					System.arraycopy(
							Tools.sortToByte(Tools.int2Bytes(paramValue, 4)), 0,
							data, dstPos, 4);
				} catch (Exception e) {
					AppLog.e(ExceptionUtil.getInfo(e));
					e.printStackTrace();
				}
				break;
			case 0x0023: // UINT32 ACC OFF汇报时间间隔，单位为秒（s）
				try {
					int paramValue = SPUtils.getParamInteger(
							SPConstants.PARAMS_ACC_OFF_REPORT_TIME, 30);
					data = new byte[3 + 4];
					// 参数ID UINT16
					System.arraycopy(Tools.sortToByte(Tools.int2Bytes(paramId, 2)),
							0, data, dstPos, 2);
					dstPos += 2;
					// 参数长度 UINT8
					System.arraycopy(Tools.sortToByte(Tools.int2Bytes(4, 1)), 0,
							data, dstPos, 1);
					dstPos += 1;
					// 参数
					System.arraycopy(
							Tools.sortToByte(Tools.int2Bytes(paramValue, 4)), 0,
							data, dstPos, 4);
				} catch (Exception e) {
					AppLog.e(ExceptionUtil.getInfo(e));
					e.printStackTrace();
				}
				break;
			case 0x0024: // UINT32 ACC ON汇报时间间隔，单位为秒（s）
				try {
					int paramValue = SPUtils.getParamInteger(
							SPConstants.PARAMS_ACC_ON_REPORT_TIME, 30);
					data = new byte[3 + 4];
					// 参数ID UINT16
					System.arraycopy(Tools.sortToByte(Tools.int2Bytes(paramId, 2)),
							0, data, dstPos, 2);
					dstPos += 2;
					// 参数长度 UINT8
					System.arraycopy(Tools.sortToByte(Tools.int2Bytes(4, 1)), 0,
							data, dstPos, 1);
					dstPos += 1;
					// 参数
					System.arraycopy(
							Tools.sortToByte(Tools.int2Bytes(paramValue, 4)), 0,
							data, dstPos, 4);
				} catch (Exception e) {
					AppLog.e(ExceptionUtil.getInfo(e));
					e.printStackTrace();
				}
				break;
			case 0x0025: // UINT32 空车汇报时间间隔，单位为秒（s）
				try {
					int paramValue = DeviceBiz.getEmptyCarHeartTime();
					data = new byte[3 + 4];
					// 参数ID UINT16
					System.arraycopy(Tools.sortToByte(Tools.int2Bytes(paramId, 2)),
							0, data, dstPos, 2);
					dstPos += 2;
					// 参数长度 UINT8
					System.arraycopy(Tools.sortToByte(Tools.int2Bytes(4, 1)), 0,
							data, dstPos, 1);
					dstPos += 1;
					// 参数
					System.arraycopy(
							Tools.sortToByte(Tools.int2Bytes(paramValue, 4)), 0,
							data, dstPos, 4);
				} catch (Exception e) {
					AppLog.e(ExceptionUtil.getInfo(e));
					e.printStackTrace();
				}
				break;
			case 0x0026: // UINT32 重车汇报时间间隔，单位为秒（s）
				try {
					int paramValue = DeviceBiz.getFullCarHeartTime();
					data = new byte[3 + 4];
					// 参数ID UINT16
					System.arraycopy(Tools.sortToByte(Tools.int2Bytes(paramId, 2)),
							0, data, dstPos, 2);
					dstPos += 2;
					// 参数长度 UINT8
					System.arraycopy(Tools.sortToByte(Tools.int2Bytes(4, 1)), 0,
							data, dstPos, 1);
					dstPos += 1;
					// 参数
					System.arraycopy(
							Tools.sortToByte(Tools.int2Bytes(paramValue, 4)), 0,
							data, dstPos, 4);
				} catch (Exception e) {

					AppLog.e(TAG);
					e.printStackTrace();
				}
				break;
			case 0x0027:	// UINT32	休眠时汇报时间间隔，单位为秒（s）
				try {
					int paramValue = SPUtils.defaultPref().getInt(SPConstants.PARAMS_DORMANT_REPORT_TIME, 30);
					data = new byte[3+4];
					// 参数ID	UINT16
					System.arraycopy(Tools.sortToByte(Tools.int2Bytes(paramId,2)), 0, data, dstPos, 2);
					dstPos+=2;
					// 参数长度	UINT8
					System.arraycopy(Tools.sortToByte(Tools.int2Bytes(4,1)), 0, data, dstPos, 1);
					dstPos+=1;
					//参数
					System.arraycopy(Tools.sortToByte(Tools.int2Bytes(paramValue,4)), 0, data, dstPos, 4);
				} catch (Exception e) {
					AppLog.e(ExceptionUtil.getInfo(e), e);
					e.printStackTrace();
				}
				break;
			case 0x0028: // UINT32 紧急报警时汇报时间间隔，单位为秒（s）
				try {
					int paramValue = SPUtils.getParamInteger(
							SPConstants.PARAMS_URGENCY_ALARM_REPORT_TIME, 5);
					data = new byte[3 + 4];
					// 参数ID UINT16
					System.arraycopy(Tools.sortToByte(Tools.int2Bytes(paramId, 2)),
							0, data, dstPos, 2);
					dstPos += 2;
					// 参数长度 UINT8
					System.arraycopy(Tools.sortToByte(Tools.int2Bytes(4, 1)), 0,
							data, dstPos, 1);
					dstPos += 1;
					// 参数
					System.arraycopy(
							Tools.sortToByte(Tools.int2Bytes(paramValue, 4)), 0,
							data, dstPos, 4);
				} catch (Exception e) {
					AppLog.e(ExceptionUtil.getInfo(e));
					e.printStackTrace();
				}
				break;
			case 0x0029:	// UINT32	未登录汇报距离间隔，
				try {
					int paramValue = SPUtils.getParamInteger(
							SPConstants.PARAMS_OFFLINE_REPORT_DISTANCE, 500);
					data = new byte[3+4];
					// 参数ID	UINT16
					System.arraycopy(Tools.sortToByte(Tools.int2Bytes(paramId,2)), 0, data, dstPos, 2);
					dstPos+=2;
					// 参数长度	UINT8
					System.arraycopy(Tools.sortToByte(Tools.int2Bytes(4,1)), 0, data, dstPos, 1);
					dstPos+=1;
					//参数
					System.arraycopy(Tools.sortToByte(Tools.int2Bytes(paramValue,4)), 0, data, dstPos, 4);
				} catch (Exception e) {
					AppLog.e(ExceptionUtil.getInfo(e), e);
					e.printStackTrace();
				}
				break;
			case 0x002A:	// UINT32	ACC OFF汇报距离间隔，单位为米（m）
				try {
					int paramValue = SPUtils.getParamInteger(
							SPConstants.PARAMS_ACC_OFF_REPORT_DISTANCE, 500);
					data = new byte[3+4];
					// 参数ID	UINT16
					System.arraycopy(Tools.sortToByte(Tools.int2Bytes(paramId,2)), 0, data, dstPos, 2);
					dstPos+=2;
					// 参数长度	UINT8
					System.arraycopy(Tools.sortToByte(Tools.int2Bytes(4,1)), 0, data, dstPos, 1);
					dstPos+=1;
					//参数
					System.arraycopy(Tools.sortToByte(Tools.int2Bytes(paramValue,4)), 0, data, dstPos, 4);
				} catch (Exception e) {
					AppLog.e(ExceptionUtil.getInfo(e), e);
					e.printStackTrace();
				}
				break;
			case 0x002B:	// UINT32	ACC ON汇报距离间隔，单位为米（m）
				try {
					int paramValue = SPUtils.getParamInteger(
							SPConstants.PARAMS_ACC_ON_REPORT_DISTANCE, 500);
					data = new byte[3+4];
					// 参数ID	UINT16
					System.arraycopy(Tools.sortToByte(Tools.int2Bytes(paramId,2)), 0, data, dstPos, 2);
					dstPos+=2;
					// 参数长度	UINT8
					System.arraycopy(Tools.sortToByte(Tools.int2Bytes(4,1)), 0, data, dstPos, 1);
					dstPos+=1;
					//参数
					System.arraycopy(Tools.sortToByte(Tools.int2Bytes(paramValue,4)), 0, data, dstPos, 4);
				} catch (Exception e) {
					AppLog.e(ExceptionUtil.getInfo(e), e);
					e.printStackTrace();
				}
				break;
			case 0x002C:	// UINT32	空车汇报距离间隔，单位为米（m）
				try {
					int paramValue = SPUtils.getParamInteger(
							SPConstants.PARAMS_EMPTY_REPORT_DISTANCE, 500);
					data = new byte[3+4];
					// 参数ID	UINT16
					System.arraycopy(Tools.sortToByte(Tools.int2Bytes(paramId,2)), 0, data, dstPos, 2);
					dstPos+=2;
					// 参数长度	UINT8
					System.arraycopy(Tools.sortToByte(Tools.int2Bytes(4,1)), 0, data, dstPos, 1);
					dstPos+=1;
					//参数
					System.arraycopy(Tools.sortToByte(Tools.int2Bytes(paramValue,4)), 0, data, dstPos, 4);
				} catch (Exception e) {
					AppLog.e(ExceptionUtil.getInfo(e), e);
					e.printStackTrace();
				}
				break;
			case 0x002D:	// UINT32	重车汇报距离间隔，单位为米（m）
				try {
					int paramValue = SPUtils.getParamInteger(
							SPConstants.PARAMS_FULL_REPORT_DISTANCE, 500);
					data = new byte[3+4];
					// 参数ID	UINT16
					System.arraycopy(Tools.sortToByte(Tools.int2Bytes(paramId,2)), 0, data, dstPos, 2);
					dstPos+=2;
					// 参数长度	UINT8
					System.arraycopy(Tools.sortToByte(Tools.int2Bytes(4,1)), 0, data, dstPos, 1);
					dstPos+=1;
					//参数
					System.arraycopy(Tools.sortToByte(Tools.int2Bytes(paramValue,4)), 0, data, dstPos, 4);
				} catch (Exception e) {
					AppLog.e(ExceptionUtil.getInfo(e), e);
					e.printStackTrace();
				}
				break;
			case 0x002E:	// UINT32	休眠时汇报距离间隔，单位为米（m）
				try {
					int paramValue = SPUtils.defaultPref().getInt(SPConstants.PARAMS_DORMANT_REPORT_DISTANCE, 500);
					data = new byte[3+4];
					// 参数ID	UINT16
					System.arraycopy(Tools.sortToByte(Tools.int2Bytes(paramId,2)), 0, data, dstPos, 2);
					dstPos+=2;
					// 参数长度	UINT8
					System.arraycopy(Tools.sortToByte(Tools.int2Bytes(4,1)), 0, data, dstPos, 1);
					dstPos+=1;
					//参数
					System.arraycopy(Tools.sortToByte(Tools.int2Bytes(paramValue,4)), 0, data, dstPos, 4);
				} catch (Exception e) {
					AppLog.e(ExceptionUtil.getInfo(e), e);
					e.printStackTrace();
				}
				break;
			case 0x002F:	// UINT32	紧急报警时汇报距离间隔，单位为米（m）
				try {
					int paramValue = SPUtils.getParamInteger(
							SPConstants.PARAMS_URGENCY_ALARM_REPORT_DISTANCE, 200);
					data = new byte[3+4];
					// 参数ID	UINT16
					System.arraycopy(Tools.sortToByte(Tools.int2Bytes(paramId,2)), 0, data, dstPos, 2);
					dstPos+=2;
					// 参数长度	UINT8
					System.arraycopy(Tools.sortToByte(Tools.int2Bytes(4,1)), 0, data, dstPos, 1);
					dstPos+=1;
					//参数
					System.arraycopy(Tools.sortToByte(Tools.int2Bytes(paramValue,4)), 0, data, dstPos, 4);
				} catch (Exception e) {
					AppLog.e(ExceptionUtil.getInfo(e), e);
					e.printStackTrace();
				}
				break;
			case 0x0030: // UINT32 拐点补传角度，<180°
				try {
					int paramValue = SPUtils.getParamInteger(
							SPConstants.PARAMS_FILL_THE_ANGLE, 0);
					data = new byte[3 + 4];
					// 参数ID UINT16
					System.arraycopy(Tools.sortToByte(Tools.int2Bytes(paramId, 2)),
							0, data, dstPos, 2);
					dstPos += 2;
					// 参数长度 UINT8
					System.arraycopy(Tools.sortToByte(Tools.int2Bytes(4, 1)), 0,
							data, dstPos, 1);
					dstPos += 1;
					// 参数
					System.arraycopy(
							Tools.sortToByte(Tools.int2Bytes(paramValue, 4)), 0,
							data, dstPos, 4);
				} catch (Exception e) {
					AppLog.e(ExceptionUtil.getInfo(e));
					e.printStackTrace();
				}
				break;
			case 0x0040: // STRING 监控指挥中心电话号码
				try {
					String paramValue = SPUtils.getParamString(
							SPConstants.PARAMS_CENTRA_PHONE, "");
					byte[] paramValueByte = (paramValue + "\0").getBytes("GBK");
					data = new byte[3 + paramValueByte.length];
					// 参数ID UINT16
					System.arraycopy(Tools.sortToByte(Tools.int2Bytes(paramId, 2)),
							0, data, dstPos, 2);
					dstPos += 2;
					// 参数长度 UINT8
					System.arraycopy(Tools.sortToByte(Tools.int2Bytes(
							paramValueByte.length, 1)), 0, data, dstPos, 1);
					dstPos += 1;
					// 参数
					System.arraycopy(paramValueByte, 0, data, dstPos,
							paramValueByte.length);
				} catch (Exception e) {
					AppLog.e(ExceptionUtil.getInfo(e));
					e.printStackTrace();
				}
				break;
			case 0x0041: // STRING 复位电话号码
				try {
					String paramValue = SPUtils.getParamString(
							SPConstants.PARAMS_RESET_PHONE, "");
					byte[] paramValueByte = (paramValue + "\0").getBytes("GBK");
					data = new byte[3 + paramValueByte.length];
					// 参数ID UINT16
					System.arraycopy(Tools.sortToByte(Tools.int2Bytes(paramId, 2)),
							0, data, dstPos, 2);
					dstPos += 2;
					// 参数长度 UINT8
					System.arraycopy(Tools.sortToByte(Tools.int2Bytes(
							paramValueByte.length, 1)), 0, data, dstPos, 1);
					dstPos += 1;
					// 参数
					System.arraycopy(paramValueByte, 0, data, dstPos,
							paramValueByte.length);
				} catch (Exception e) {
					AppLog.e(ExceptionUtil.getInfo(e));
					e.printStackTrace();
				}
				break;
			case 0x0042:	// STRING	恢复出厂设置电话号码
				try {
					String paramValue = SPUtils.defaultPref().getString(SPConstants.PARAMS_RESET_FIRST_PHONE, "13911100999");
					byte[] paramValueByte = (paramValue).getBytes("GBK");
					data = new byte[3+paramValueByte.length];
					// 参数ID	UINT16
					System.arraycopy(Tools.sortToByte(Tools.int2Bytes(paramId,2)), 0, data, dstPos, 2);
					dstPos+=2;
					// 参数长度	UINT8
					System.arraycopy(Tools.sortToByte(Tools.int2Bytes(paramValueByte.length,1)), 0, data, dstPos, 1);
					dstPos+=1;
					//参数
					System.arraycopy(paramValueByte, 0, data, dstPos, paramValueByte.length);
				} catch (Exception e) {
					AppLog.e(ExceptionUtil.getInfo(e), e);
					e.printStackTrace();
				}
				break;
			case 0x0043:	// STRING	监控指挥中心SMS电话号码
				try {
					String paramValue = SPUtils.defaultPref().getString(SPConstants.PARAMS_CENTRA_SMS_PHONE, "13911100999");
					byte[] paramValueByte = (paramValue).getBytes("GBK");
					data = new byte[3+paramValueByte.length];
					// 参数ID	UINT16
					System.arraycopy(Tools.sortToByte(Tools.int2Bytes(paramId,2)), 0, data, dstPos, 2);
					dstPos+=2;
					// 参数长度	UINT8
					System.arraycopy(Tools.sortToByte(Tools.int2Bytes(paramValueByte.length,1)), 0, data, dstPos, 1);
					dstPos+=1;
					//参数
					System.arraycopy(paramValueByte, 0, data, dstPos, paramValueByte.length);
				} catch (Exception e) {
					AppLog.e(ExceptionUtil.getInfo(e), e);
					e.printStackTrace();
				}
				break;
			case 0x0044:	// STRING	接收ISUSMS文本报警号码
				try {
					String paramValue = SPUtils.defaultPref().getString(SPConstants.PARAMS_SMS_ALARM_PHONE, "");
					byte[] paramValueByte = (paramValue).getBytes("GBK");
					data = new byte[3+paramValueByte.length];
					// 参数ID	UINT16
					System.arraycopy(Tools.sortToByte(Tools.int2Bytes(paramId,2)), 0, data, dstPos, 2);
					dstPos+=2;
					// 参数长度	UINT8
					System.arraycopy(Tools.sortToByte(Tools.int2Bytes(paramValueByte.length,1)), 0, data, dstPos, 1);
					dstPos+=1;
					//参数
					System.arraycopy(paramValueByte, 0, data, dstPos, paramValueByte.length);
				} catch (Exception e) {

					AppLog.e(TAG, e);
					e.printStackTrace();
				}
				break;
			case 0x0045: // UINT32 ISU电话接听策略：0：自动接听 1：ACC ON时自动接听，OFF时手动接听
				try {
					int paramValue = SPUtils.getParamInteger(
							SPConstants.PARAMS_ANSWER_CALL_TYPE, 0);
					data = new byte[3 + 4];
					// 参数ID UINT16
					System.arraycopy(Tools.sortToByte(Tools.int2Bytes(paramId, 2)),
							0, data, dstPos, 2);
					dstPos += 2;
					// 参数长度 UINT8
					System.arraycopy(Tools.sortToByte(Tools.int2Bytes(4, 1)), 0,
							data, dstPos, 1);
					dstPos += 1;
					// 参数
					System.arraycopy(
							Tools.sortToByte(Tools.int2Bytes(paramValue, 4)), 0,
							data, dstPos, 4);
				} catch (Exception e) {
					AppLog.e(ExceptionUtil.getInfo(e));
					e.printStackTrace();
				}
				break;
			case 0x0046: // UINT32 每次最长通话时间，单位为秒（s）
				try {
					int paramValue = DeviceBiz.getMaxCall();
					data = new byte[3 + 4];
					// 参数ID UINT16
					System.arraycopy(Tools.sortToByte(Tools.int2Bytes(paramId, 2)),
							0, data, dstPos, 2);
					dstPos += 2;
					// 参数长度 UINT8
					System.arraycopy(Tools.sortToByte(Tools.int2Bytes(4, 1)), 0,
							data, dstPos, 1);
					dstPos += 1;
					// 参数
					System.arraycopy(
							Tools.sortToByte(Tools.int2Bytes(paramValue, 4)), 0,
							data, dstPos, 4);
				} catch (Exception e) {
					AppLog.e(ExceptionUtil.getInfo(e));
					e.printStackTrace();
				}
				break;
			case 0x0047:	// UINT32	当月最长通话时间，单位为秒（s）
				try {
					int paramValue = SPUtils.defaultPref().getInt(SPConstants.PARAMS_MAX_CALL_MONTH_TIME, 30 * 24 * 60 * 60);
					data = new byte[3+4];
					// 参数ID	UINT16
					System.arraycopy(Tools.sortToByte(Tools.int2Bytes(paramId,2)), 0, data, dstPos, 2);
					dstPos+=2;
					// 参数长度	UINT8
					System.arraycopy(Tools.sortToByte(Tools.int2Bytes(4,1)), 0, data, dstPos, 1);
					dstPos+=1;
					//参数
					System.arraycopy(Tools.sortToByte(Tools.int2Bytes(paramValue,4)), 0, data, dstPos, 4);
				} catch (Exception e) {
					AppLog.e(ExceptionUtil.getInfo(e), e);
					e.printStackTrace();
				}
				break;
			case 0x0048:	// 0X0048	UINT32	电话短号长度
				try {
					int paramValue = SPUtils.defaultPref().getInt(SPConstants.PARAMS_SHORT_LENGTH, 0);
					data = new byte[3+4];
					// 参数ID	UINT16
					System.arraycopy(Tools.sortToByte(Tools.int2Bytes(paramId,2)), 0, data, dstPos, 2);
					dstPos+=2;
					// 参数长度	UINT8
					System.arraycopy(Tools.sortToByte(Tools.int2Bytes(4,1)), 0, data, dstPos, 1);
					dstPos+=1;
					//参数
					System.arraycopy(Tools.sortToByte(Tools.int2Bytes(paramValue,4)), 0, data, dstPos, 4);
				} catch (Exception e) {
					AppLog.e(ExceptionUtil.getInfo(e), e);
					e.printStackTrace();
				}
				break;
			case 0x0049: // STRING 监听电话号码
				try {
					String paramValue = SPUtils.getParamString(
							SPConstants.PARAMS_MONITOR_PHONE, "");
					byte[] paramValueByte = (paramValue + "\0").getBytes("GBK");
					data = new byte[3 + paramValueByte.length];
					// 参数ID UINT16
					System.arraycopy(Tools.sortToByte(Tools.int2Bytes(paramId, 2)),
							0, data, dstPos, 2);
					dstPos += 2;
					// 参数长度 UINT8
					System.arraycopy(Tools.sortToByte(Tools.int2Bytes(
							paramValueByte.length, 1)), 0, data, dstPos, 1);
					dstPos += 1;
					// 参数
					System.arraycopy(paramValueByte, 0, data, dstPos,
							paramValueByte.length);
				} catch (Exception e) {
					AppLog.e(ExceptionUtil.getInfo(e));
					e.printStackTrace();
				}
				break;
			case 0x004A: // STRING ISU设备维护密码
				try {
					String paramValue = Constants.VALIDATION_PASSWD;
					byte[] paramValueByte = (paramValue + "\0").getBytes("GBK");
					data = new byte[3 + paramValueByte.length];
					// 参数ID UINT16
					System.arraycopy(Tools.sortToByte(Tools.int2Bytes(paramId, 2)),
							0, data, dstPos, 2);
					dstPos += 2;
					// 参数长度 UINT8
					System.arraycopy(Tools.sortToByte(Tools.int2Bytes(
							paramValueByte.length, 1)), 0, data, dstPos, 1);
					dstPos += 1;
					// 参数
					System.arraycopy(paramValueByte, 0, data, dstPos,
							paramValueByte.length);
				} catch (Exception e) {
					AppLog.e(ExceptionUtil.getInfo(e));
					e.printStackTrace();
				}
				break;
			case 0x004B:	// UINT	ISU的语音播报音量控制：0～9 （0为静音，9为最高）
				try {
					int vol = 5;

					data = new byte[3+1];
					// 参数ID	UINT16
					System.arraycopy(Tools.sortToByte(Tools.int2Bytes(paramId,2)), 0, data, dstPos, 2);
					dstPos+=2;
					// 参数长度	UINT8
					System.arraycopy(Tools.sortToByte(Tools.int2Bytes(1,1)), 0, data, dstPos, 1);
					dstPos+=1;
					//参数
					System.arraycopy(Tools.sortToByte(Tools.int2Bytes(vol,1)), 0, data, dstPos, 1);
				} catch (Exception e) {
					AppLog.e(ExceptionUtil.getInfo(e), e);
					e.printStackTrace();
				}
				break;
			case 0x0050:	// UINT32	报警屏蔽字，与位置信息汇报消息中的报警标志相对应，相应位为1则相应报警被屏蔽
				try {
					int paramValue = SPUtils.defaultPref().getInt(SPConstants.PARAMS_ALARM_FLAG, 0);
					data = new byte[3+4];
					// 参数ID	UINT16
					System.arraycopy(Tools.sortToByte(Tools.int2Bytes(paramId,2)), 0, data, dstPos, 2);
					dstPos+=2;
					// 参数长度	UINT8
					System.arraycopy(Tools.sortToByte(Tools.int2Bytes(4,1)), 0, data, dstPos, 1);
					dstPos+=1;
					//参数
					System.arraycopy(Tools.sortToByte(Tools.int2Bytes(paramValue,4)), 0, data, dstPos, 4);
				} catch (Exception e) {
					AppLog.e(ExceptionUtil.getInfo(e), e);
					e.printStackTrace();
				}
				break;
			case 0x0051:	// UINT32	报警发送文本SMS开关，与位置信息汇报消息中的报警标志相对应，相应位为1则相应报警时发送文本SMS
				try {
					int paramValue = SPUtils.defaultPref().getInt(SPConstants.PARAMS_ALARM_SMS_SWITCHER, 0);
					data = new byte[3+4];
					// 参数ID	UINT16
					System.arraycopy(Tools.sortToByte(Tools.int2Bytes(paramId,2)), 0, data, dstPos, 2);
					dstPos+=2;
					// 参数长度	UINT8
					System.arraycopy(Tools.sortToByte(Tools.int2Bytes(4,1)), 0, data, dstPos, 1);
					dstPos+=1;
					//参数
					System.arraycopy(Tools.sortToByte(Tools.int2Bytes(paramValue,4)), 0, data, dstPos, 4);
				} catch (Exception e) {
					AppLog.e(ExceptionUtil.getInfo(e), e);
					e.printStackTrace();
				}
				break;
			case 0x0052:	// UINT32	报警拍摄开关，与位置信息汇报消息中的报警标志相对应，相应位为1则相应报警时摄像头拍摄
				try {
					int paramValue = SPUtils.defaultPref().getInt(SPConstants.PARAMS_ALARM_FILM_SWITCHER, 1);
					data = new byte[3+4];
					// 参数ID	UINT16
					System.arraycopy(Tools.sortToByte(Tools.int2Bytes(paramId,2)), 0, data, dstPos, 2);
					dstPos+=2;
					// 参数长度	UINT8
					System.arraycopy(Tools.sortToByte(Tools.int2Bytes(4,1)), 0, data, dstPos, 1);
					dstPos+=1;
					//参数
					System.arraycopy(Tools.sortToByte(Tools.int2Bytes(paramValue,4)), 0, data, dstPos, 4);
				} catch (Exception e) {
					AppLog.e(ExceptionUtil.getInfo(e), e);
					e.printStackTrace();
				}
				break;
			case 0x0053:	// UINT32	报警拍摄存储标志，与位置信息汇报消息中的报警标志相对应，相应位为1则对相应报警时拍的照片进行存储，否则实时上传
				try {
					int paramValue = SPUtils.defaultPref().getInt(SPConstants.PARAMS_ALARM_FILM_SAVE_SWITCHER, 1);
					data = new byte[3+4];
					// 参数ID	UINT16
					System.arraycopy(Tools.sortToByte(Tools.int2Bytes(paramId,2)), 0, data, dstPos, 2);
					dstPos+=2;
					// 参数长度	UINT8
					System.arraycopy(Tools.sortToByte(Tools.int2Bytes(4,1)), 0, data, dstPos, 1);
					dstPos+=1;
					//参数
					System.arraycopy(Tools.sortToByte(Tools.int2Bytes(paramValue,4)), 0, data, dstPos, 4);
				} catch (Exception e) {
					AppLog.e(ExceptionUtil.getInfo(e), e);
					e.printStackTrace();
				}
				break;
			case 0x0055: // UINT32 最高速度，单位为千米每小时（km/h）
				try {
					int paramValue = SPUtils.getParamInteger(
							SPConstants.PARAMS_MAX_SPEED, 120);
					data = new byte[3 + 4];
					// 参数ID UINT16
					System.arraycopy(Tools.sortToByte(Tools.int2Bytes(paramId, 2)),
							0, data, dstPos, 2);
					dstPos += 2;
					// 参数长度 UINT8
					System.arraycopy(Tools.sortToByte(Tools.int2Bytes(4, 1)), 0,
							data, dstPos, 1);
					dstPos += 1;
					// 参数
					System.arraycopy(
							Tools.sortToByte(Tools.int2Bytes(paramValue, 4)), 0,
							data, dstPos, 4);
				} catch (Exception e) {
					AppLog.e(ExceptionUtil.getInfo(e));
					e.printStackTrace();
				}
				break;
			case 0x0056: // UINT32 超速持续时间，单位为秒（s）
				try {
					int paramValue = SPUtils.getParamInteger(
							SPConstants.PARAMS_SPEEDING_TIME, 10);
					data = new byte[3 + 4];
					// 参数ID UINT16
					System.arraycopy(Tools.sortToByte(Tools.int2Bytes(paramId, 2)),
							0, data, dstPos, 2);
					dstPos += 2;
					// 参数长度 UINT8
					System.arraycopy(Tools.sortToByte(Tools.int2Bytes(4, 1)), 0,
							data, dstPos, 1);
					dstPos += 1;
					// 参数
					System.arraycopy(
							Tools.sortToByte(Tools.int2Bytes(paramValue, 4)), 0,
							data, dstPos, 4);
				} catch (Exception e) {
					AppLog.e(ExceptionUtil.getInfo(e));
					e.printStackTrace();
				}
				break;
			case 0x0057: // UINT32 连续驾驶时间门限，单位为秒（s）
				try {
					int paramValue = SPUtils.getParamInteger(
							SPConstants.PARAMS_MAX_RUN_TIME, 0);
					data = new byte[3 + 4];
					// 参数ID UINT16
					System.arraycopy(Tools.sortToByte(Tools.int2Bytes(paramId, 2)),
							0, data, dstPos, 2);
					dstPos += 2;
					// 参数长度 UINT8
					System.arraycopy(Tools.sortToByte(Tools.int2Bytes(4, 1)), 0,
							data, dstPos, 1);
					dstPos += 1;
					// 参数
					System.arraycopy(
							Tools.sortToByte(Tools.int2Bytes(paramValue, 4)), 0,
							data, dstPos, 4);
				} catch (Exception e) {
					AppLog.e(ExceptionUtil.getInfo(e));
					e.printStackTrace();
				}
				break;
			case 0x0058:	// DWORD	最小休息时间，单位为秒（s）
				try {
					int paramValue = SPUtils.getParamInteger(
							SPConstants.PARAMS_MIN_REST_TIME, 0);
					data = new byte[3+4];
					// 参数ID	UINT16
					System.arraycopy(Tools.sortToByte(Tools.int2Bytes(paramId,2)), 0, data, dstPos, 2);
					dstPos+=2;
					// 参数长度	UINT8
					System.arraycopy(Tools.sortToByte(Tools.int2Bytes(4,1)), 0, data, dstPos, 1);
					dstPos+=1;
					//参数
					System.arraycopy(Tools.sortToByte(Tools.int2Bytes(paramValue,4)), 0, data, dstPos, 4);
				} catch (Exception e) {
					AppLog.e(ExceptionUtil.getInfo(e), e);
					e.printStackTrace();
				}
				break;
			case 0x0059: // DWORD 最小休息时间，单位为秒（s）
				try {
					int paramValue = SPUtils.getParamInteger(
							SPConstants.PARAMS_MIN_REST_TIME, 0);
					data = new byte[3 + 4];
					// 参数ID UINT16
					System.arraycopy(Tools.sortToByte(Tools.int2Bytes(paramId, 2)),
							0, data, dstPos, 2);
					dstPos += 2;
					// 参数长度 UINT8
					System.arraycopy(Tools.sortToByte(Tools.int2Bytes(4, 1)), 0,
							data, dstPos, 1);
					dstPos += 1;
					// 参数
					System.arraycopy(
							Tools.sortToByte(Tools.int2Bytes(paramValue, 4)), 0,
							data, dstPos, 4);
				} catch (Exception e) {
					AppLog.e(ExceptionUtil.getInfo(e));
					e.printStackTrace();
				}
				break;
			case 0x005A:	// DWORD	当天累计驾驶时间门限，单位为秒（s）
				try {
					int paramValue = SPUtils.getParamInteger(
							SPConstants.PARAMS_MAX_DAILY_RUN_TIME, 0);
					data = new byte[3+4];
					// 参数ID	UINT16
					System.arraycopy(Tools.sortToByte(Tools.int2Bytes(paramId,2)), 0, data, dstPos, 2);
					dstPos+=2;
					// 参数长度	UINT8
					System.arraycopy(Tools.sortToByte(Tools.int2Bytes(4,1)), 0, data, dstPos, 1);
					dstPos+=1;
					//参数
					System.arraycopy(Tools.sortToByte(Tools.int2Bytes(paramValue,4)), 0, data, dstPos, 4);
				} catch (Exception e) {
					AppLog.e(ExceptionUtil.getInfo(e), e);
					e.printStackTrace();
				}
				break;
			case 0x005B:	// WORD	事件触发拍照控制，参见附录D
				try {
					int paramValue = SPUtils.defaultPref().getInt(SPConstants.PARAMS_PHOTOGRAPH_TRIGGER, 0);
					data = new byte[3+2];
					// 参数ID	UINT16
					System.arraycopy(Tools.sortToByte(Tools.int2Bytes(paramId,2)), 0, data, dstPos, 2);
					dstPos+=2;
					// 参数长度	UINT8
					System.arraycopy(Tools.sortToByte(Tools.int2Bytes(2,1)), 0, data, dstPos, 1);
					dstPos+=1;
					//参数
					System.arraycopy(Tools.sortToByte(Tools.int2Bytes(paramValue,2)), 0, data, dstPos, 2);
				} catch (Exception e) {
					AppLog.e(ExceptionUtil.getInfo(e), e);
					e.printStackTrace();
				}
				break;
			case 0x005C:	// WORD	拍照存储控制，参见表附录D
				try {
					int paramValue = SPUtils.defaultPref().getInt(SPConstants.PARAMS_PICTRUE_SAVE, 0);
					data = new byte[3+2];
					// 参数ID	UINT16
					System.arraycopy(Tools.sortToByte(Tools.int2Bytes(paramId,2)), 0, data, dstPos, 2);
					dstPos+=2;
					// 参数长度	UINT8
					System.arraycopy(Tools.sortToByte(Tools.int2Bytes(2,1)), 0, data, dstPos, 1);
					dstPos+=1;
					//参数
					System.arraycopy(Tools.sortToByte(Tools.int2Bytes(paramValue,2)), 0, data, dstPos, 2);
				} catch (Exception e) {
					AppLog.e(ExceptionUtil.getInfo(e), e);
					e.printStackTrace();
				}
				break;

			case 0x0070:	// UINT32	图像/视频质量，1～10，1最好
				try {
					int paramValue = SPUtils.defaultPref().getInt(SPConstants.PARAMS_VEDIO_LEVEL, 2);
					data = new byte[3+4];
					// 参数ID	UINT16
					System.arraycopy(Tools.sortToByte(Tools.int2Bytes(paramId,2)), 0, data, dstPos, 2);
					dstPos+=2;
					// 参数长度	UINT8
					System.arraycopy(Tools.sortToByte(Tools.int2Bytes(4,1)), 0, data, dstPos, 1);
					dstPos+=1;
					//参数
					System.arraycopy(Tools.sortToByte(Tools.int2Bytes(paramValue,4)), 0, data, dstPos, 4);
				} catch (Exception e) {
					AppLog.e(ExceptionUtil.getInfo(e), e);
					e.printStackTrace();
				}
				break;
			case 0x0071:	// UINT32	亮度，0～255
				try {
					int paramValue = SPUtils.defaultPref().getInt(SPConstants.PARAMS_BRIGHTNESS, 255);
					try {
						paramValue = CarCallSystemBiz.getScreenBrightness(MainApplication.topActivity);
					} catch (Exception e) {
						e.printStackTrace();
					}

					data = new byte[3+4];
					// 参数ID	UINT16
					System.arraycopy(Tools.sortToByte(Tools.int2Bytes(paramId,2)), 0, data, dstPos, 2);
					dstPos+=2;
					// 参数长度	UINT8
					System.arraycopy(Tools.sortToByte(Tools.int2Bytes(4,1)), 0, data, dstPos, 1);
					dstPos+=1;
					//参数
					System.arraycopy(Tools.sortToByte(Tools.int2Bytes(paramValue,4)), 0, data, dstPos, 4);
				} catch (Exception e) {
					AppLog.e(ExceptionUtil.getInfo(e), e);
					e.printStackTrace();
				}
				break;
			case 0x0072:	// UINT32	对比度，0～127
				try {
					int paramValue = SPUtils.defaultPref().getInt(SPConstants.PARAMS_CONTRAST, 127);
					data = new byte[3+4];
					// 参数ID	UINT16
					System.arraycopy(Tools.sortToByte(Tools.int2Bytes(paramId,2)), 0, data, dstPos, 2);
					dstPos+=2;
					// 参数长度	UINT8
					System.arraycopy(Tools.sortToByte(Tools.int2Bytes(4,1)), 0, data, dstPos, 1);
					dstPos+=1;
					//参数
					System.arraycopy(Tools.sortToByte(Tools.int2Bytes(paramValue,4)), 0, data, dstPos, 4);
				} catch (Exception e) {
					AppLog.e(ExceptionUtil.getInfo(e), e);
					e.printStackTrace();
				}
				break;
			case 0x0073:	// UINT32	饱和度，0～127
				try {
					int paramValue = SPUtils.defaultPref().getInt(SPConstants.PARAMS_SATURABILITY, 127);
					data = new byte[3+4];
					// 参数ID	UINT16
					System.arraycopy(Tools.sortToByte(Tools.int2Bytes(paramId,2)), 0, data, dstPos, 2);
					dstPos+=2;
					// 参数长度	UINT8
					System.arraycopy(Tools.sortToByte(Tools.int2Bytes(4,1)), 0, data, dstPos, 1);
					dstPos+=1;
					//参数
					System.arraycopy(Tools.sortToByte(Tools.int2Bytes(paramValue,4)), 0, data, dstPos, 4);
				} catch (Exception e) {
					AppLog.e(ExceptionUtil.getInfo(e), e);
					e.printStackTrace();
				}
				break;
			case 0x0074:	// UINT32	色度，0～255
				try {
					int paramValue = SPUtils.defaultPref().getInt(SPConstants.PARAMS_CHROMINANCE, 255);
					data = new byte[3+4];
					// 参数ID	UINT16
					System.arraycopy(Tools.sortToByte(Tools.int2Bytes(paramId,2)), 0, data, dstPos, 2);
					dstPos+=2;
					// 参数长度	UINT8
					System.arraycopy(Tools.sortToByte(Tools.int2Bytes(4,1)), 0, data, dstPos, 1);
					dstPos+=1;
					//参数
					System.arraycopy(Tools.sortToByte(Tools.int2Bytes(paramValue,4)), 0, data, dstPos, 4);
				} catch (Exception e) {
					AppLog.e(ExceptionUtil.getInfo(e), e);
					e.printStackTrace();
				}
				break;
			case 0x0075:	//拍照照片存储策略
				try {
					int paramValue = SPUtils.defaultPref().getInt(SPConstants.PHOTOGRAPH_TAKE_STORAGE, 0);
					data = new byte[3+4];
					// 参数ID	UINT16
					System.arraycopy(Tools.sortToByte(Tools.int2Bytes(paramId,2)), 0, data, dstPos, 2);
					dstPos+=2;
					// 参数长度	UINT8
					System.arraycopy(Tools.sortToByte(Tools.int2Bytes(4,1)), 0, data, dstPos, 1);
					dstPos+=1;
					//参数
					System.arraycopy(Tools.sortToByte(Tools.int2Bytes(paramValue,4)), 0, data, dstPos, 4);
				} catch (Exception e) {
					AppLog.e(ExceptionUtil.getInfo(e), e);
					e.printStackTrace();
				}
				break;
			case 0x0076:	//拍照照片上传策略
				try {
					int paramValue = SPUtils.defaultPref().getInt(SPConstants.PHOTOGRAPH_TAKE_UPLOAD, 0);
					data = new byte[3+4];
					// 参数ID	UINT16
					System.arraycopy(Tools.sortToByte(Tools.int2Bytes(paramId,2)), 0, data, dstPos, 2);
					dstPos+=2;
					// 参数长度	UINT8
					System.arraycopy(Tools.sortToByte(Tools.int2Bytes(4,1)), 0, data, dstPos, 1);
					dstPos+=1;
					//参数
					System.arraycopy(Tools.sortToByte(Tools.int2Bytes(paramValue,4)), 0, data, dstPos, 4);
				} catch (Exception e) {
					AppLog.e(ExceptionUtil.getInfo(e), e);
					e.printStackTrace();
				}
				break;
			case 0x0077:	// UINT32	拍照类型:
				try {
					int paramValue = SPUtils.defaultPref().getInt(SPConstants.PHOTOGRAPH_TAKE_TYPE, 0);
					data = new byte[3+4];
					// 参数ID	UINT16
					System.arraycopy(Tools.sortToByte(Tools.int2Bytes(paramId,2)), 0, data, dstPos, 2);
					dstPos+=2;
					// 参数长度	UINT8
					System.arraycopy(Tools.sortToByte(Tools.int2Bytes(4,1)), 0, data, dstPos, 1);
					dstPos+=1;
					//参数
					System.arraycopy(Tools.sortToByte(Tools.int2Bytes(paramValue,4)), 0, data, dstPos, 4);
				} catch (Exception e) {
					AppLog.e(ExceptionUtil.getInfo(e), e);
					e.printStackTrace();
				}
				break;
			case 0x0078:	// UINT32	定时间隔时间:
				try {
					int paramValue = SPUtils.defaultPref().getInt(SPConstants.PHOTOGRAPH_INTERVAL_TIME, 5);
					data = new byte[3+4];
					// 参数ID	UINT16
					System.arraycopy(Tools.sortToByte(Tools.int2Bytes(paramId,2)), 0, data, dstPos, 2);
					dstPos+=2;
					// 参数长度	UINT8
					System.arraycopy(Tools.sortToByte(Tools.int2Bytes(4,1)), 0, data, dstPos, 1);
					dstPos+=1;
					//参数
					System.arraycopy(Tools.sortToByte(Tools.int2Bytes(paramValue,4)), 0, data, dstPos, 4);
				} catch (Exception e) {
					AppLog.e(ExceptionUtil.getInfo(e), e);
					e.printStackTrace();
				}
				break;
			case 0x0079:	// UINT32	定时间隔时间:
				try {
					int paramValue = SPUtils.defaultPref().getInt(SPConstants.PHOTOGRAPH_QUALITY_TYPE, 0);
					data = new byte[3+4];
					// 参数ID	UINT16
					System.arraycopy(Tools.sortToByte(Tools.int2Bytes(paramId,2)), 0, data, dstPos, 2);
					dstPos+=2;
					// 参数长度	UINT8
					System.arraycopy(Tools.sortToByte(Tools.int2Bytes(4,1)), 0, data, dstPos, 1);
					dstPos+=1;
					//参数
					System.arraycopy(Tools.sortToByte(Tools.int2Bytes(paramValue,4)), 0, data, dstPos, 4);
				} catch (Exception e) {
					AppLog.e(ExceptionUtil.getInfo(e), e);
					e.printStackTrace();
				}
				break;
			case 0x007A:	//报警时拍照的照片数量（内外均拍）。
				try {
					int paramValue = SPUtils.defaultPref().getInt(SPConstants.PHOTOGRAPH_ALARM_TOTAL, 1);
					data = new byte[3+4];
					// 参数ID	UINT16
					System.arraycopy(Tools.sortToByte(Tools.int2Bytes(paramId,2)), 0, data, dstPos, 2);
					dstPos+=2;
					// 参数长度	UINT8
					System.arraycopy(Tools.sortToByte(Tools.int2Bytes(4,1)), 0, data, dstPos, 1);
					dstPos+=1;
					//参数
					System.arraycopy(Tools.sortToByte(Tools.int2Bytes(paramValue,4)), 0, data, dstPos, 4);
				} catch (Exception e) {
					AppLog.e(ExceptionUtil.getInfo(e), e);
					e.printStackTrace();
				}
				break;
			case 0x007B:	//报警时拍照时间间隔，单位s
				try {
					int paramValue = SPUtils.defaultPref().getInt(SPConstants.PHOTOGRAPH_QUALITY_TYPE, 5);
					data = new byte[3+4];
					// 参数ID	UINT16
					System.arraycopy(Tools.sortToByte(Tools.int2Bytes(paramId,2)), 0, data, dstPos, 2);
					dstPos+=2;
					// 参数长度	UINT8
					System.arraycopy(Tools.sortToByte(Tools.int2Bytes(4,1)), 0, data, dstPos, 1);
					dstPos+=1;
					//参数
					System.arraycopy(Tools.sortToByte(Tools.int2Bytes(paramValue,4)), 0, data, dstPos, 4);
				} catch (Exception e) {
					AppLog.e(ExceptionUtil.getInfo(e), e);
					e.printStackTrace();
				}
				break;
			case 0x0080:	// UINT32	车辆里程表读数，0.1km
				try {
					// int paramValue = SPUtils.defaultPref().getInt(SPConstants.PARAMS_ODOMETER_READING, 0);
					int paramValue = 0;
					data = new byte[3+4];
					// 参数ID	UINT16
					System.arraycopy(Tools.sortToByte(Tools.int2Bytes(paramId,2)), 0, data, dstPos, 2);
					dstPos+=2;
					// 参数长度	UINT8
					System.arraycopy(Tools.sortToByte(Tools.int2Bytes(4,1)), 0, data, dstPos, 1);
					dstPos+=1;
					//参数
					System.arraycopy(Tools.sortToByte(Tools.int2Bytes(paramValue,4)), 0, data, dstPos, 4);
				} catch (Exception e) {
					AppLog.e(ExceptionUtil.getInfo(e), e);
					e.printStackTrace();
				}
				break;
			case 0x0081:	// UINT32	车辆所在的省域ID，1～255
				try {
					int paramValue = SPUtils.defaultPref().getInt(SPConstants.PARAMS_CURRENT_PROVINCE, 10);
					data = new byte[3+4];
					// 参数ID	UINT16
					System.arraycopy(Tools.sortToByte(Tools.int2Bytes(paramId,2)), 0, data, dstPos, 2);
					dstPos+=2;
					// 参数长度	UINT8
					System.arraycopy(Tools.sortToByte(Tools.int2Bytes(4,1)), 0, data, dstPos, 1);
					dstPos+=1;
					//参数
					System.arraycopy(Tools.sortToByte(Tools.int2Bytes(paramValue,4)), 0, data, dstPos, 4);
				} catch (Exception e) {
					AppLog.e(ExceptionUtil.getInfo(e), e);
					e.printStackTrace();
				}
				break;
			case 0x0082:	// UINT32	车辆所在的市域ID，1～255
				try {
					int paramValue = SPUtils.defaultPref().getInt(SPConstants.PARAMS_CURRENT_CITY, 20);
					data = new byte[3+4];
					// 参数ID	UINT16
					System.arraycopy(Tools.sortToByte(Tools.int2Bytes(paramId,2)), 0, data, dstPos, 2);
					dstPos+=2;
					// 参数长度	UINT8
					System.arraycopy(Tools.sortToByte(Tools.int2Bytes(4,1)), 0, data, dstPos, 1);
					dstPos+=1;
					//参数
					System.arraycopy(Tools.sortToByte(Tools.int2Bytes(paramValue,4)), 0, data, dstPos, 4);
				} catch (Exception e) {
					AppLog.e(ExceptionUtil.getInfo(e), e);
					e.printStackTrace();
				}
				break;
			case 0x0090:	// BCD[2]	计价器营运次数限制，0～9999；0表示不做限制
				try {
					String paramValue = SPUtils.getParamString(SPConstants.PARAMS_METER_USEABLE_COUNT,"0000");
					data = new byte[3+2];
					// 参数ID	UINT16
					System.arraycopy(Tools.sortToByte(Tools.int2Bytes(paramId,2)), 0, data, dstPos, 2);
					dstPos+=2;
					// 参数长度	UINT8
					System.arraycopy(Tools.sortToByte(Tools.int2Bytes(2,1)), 0, data, dstPos, 1);
					dstPos+=1;
					//参数
					String strValue = String.valueOf(paramValue);
					while(strValue.length() < 4){
						strValue = "0" + strValue;
					}
					System.arraycopy(Tools.parseHexStr2Byte(strValue), 0, data, dstPos, 2);
				} catch (Exception e) {
					AppLog.e(ExceptionUtil.getInfo(e), e);
					e.printStackTrace();
				}
				break;
			case 0x0091:	// BCD[5]	计价器营运时间限制，YYYYMMDDHH，0000000000表示不做限制
				try {
					String paramValue = SPUtils.getParamString(SPConstants.PARAMS_METER_USEABLE_TIME, "0000000000");
					data = new byte[3+5];
					// 参数ID	UINT16
					System.arraycopy(Tools.sortToByte(Tools.int2Bytes(paramId,2)), 0, data, dstPos, 2);
					dstPos+=2;
					// 参数长度	UINT8
					System.arraycopy(Tools.sortToByte(Tools.int2Bytes(5,1)), 0, data, dstPos, 1);
					dstPos+=1;
					//参数
					System.arraycopy(Tools.parseHexStr2Byte(String.valueOf(paramValue)), 0, data, dstPos, 5);
				} catch (Exception e) {
					AppLog.e(ExceptionUtil.getInfo(e), e);
					e.printStackTrace();
				}
				break;

			case 0x0092:	// 0x0092 	STRING	出租车企业营运许可证号
				try {
					String paramValue = DataUtil.getCompanyCode();
					byte[] paramValueByte = (paramValue).getBytes("GBK");
					data = new byte[3+paramValueByte.length];
					// 参数ID	UINT16
					System.arraycopy(Tools.sortToByte(Tools.int2Bytes(paramId,2)), 0, data, dstPos, 2);
					dstPos+=2;
					// 参数长度	UINT8
					System.arraycopy(Tools.sortToByte(Tools.int2Bytes(paramValueByte.length,1)), 0, data, dstPos, 1);
					dstPos+=1;
					//参数
					System.arraycopy(paramValueByte, 0, data, dstPos, paramValueByte.length);
				} catch (Exception e) {
					AppLog.e(ExceptionUtil.getInfo(e), e);
					e.printStackTrace();
				}
				break;
			case 0x0093:	// 0x0093	STRING	出租车企业简称
				try {
					String paramValue = "导航科技";
					byte[] paramValueByte = (paramValue).getBytes("GBK");
					data = new byte[3+paramValueByte.length];
					// 参数ID	UINT16
					System.arraycopy(Tools.sortToByte(Tools.int2Bytes(paramId,2)), 0, data, dstPos, 2);
					dstPos+=2;
					// 参数长度	UINT8
					System.arraycopy(Tools.sortToByte(Tools.int2Bytes(paramValueByte.length,1)), 0, data, dstPos, 1);
					dstPos+=1;
					//参数
					System.arraycopy(paramValueByte, 0, data, dstPos, paramValueByte.length);
				} catch (Exception e) {
					AppLog.e(ExceptionUtil.getInfo(e), e);
					e.printStackTrace();
				}
				break;
			case 0x0094: // ASCII[6] 车牌号码(不包括汉字)
				try {
					String paramValue = DeviceBiz.getCarNumberSingleLetter();
					data = new byte[3 + 6];
					// 参数ID UINT16
					System.arraycopy(Tools.sortToByte(Tools.int2Bytes(paramId, 2)),
							0, data, dstPos, 2);
					dstPos += 2;
					// 参数长度 UINT8
					System.arraycopy(Tools.sortToByte(Tools.int2Bytes(6, 1)), 0,
							data, dstPos, 1);
					dstPos += 1;
					// 参数
					System.arraycopy(Tools.stringToByte(paramValue), 0, data,
							dstPos, 6);
				} catch (Exception e) {
					AppLog.e(ExceptionUtil.getInfo(e));
					e.printStackTrace();
				}
				break;
			case 0x0095:	// 0x0095	STRING	交接班方向列表，以半角分号分隔，每个地点方向最长20字节
				try {
					String paramValue = "0000";
					data = new byte[3+2];
					// 参数ID	UINT16
					System.arraycopy(Tools.sortToByte(Tools.int2Bytes(paramId,2)), 0, data, dstPos, 2);
					dstPos+=2;
					// 参数长度	UINT8
					System.arraycopy(Tools.sortToByte(Tools.int2Bytes(2,1)), 0, data, dstPos, 1);
					dstPos+=1;
					//参数
					System.arraycopy(Tools.str2Bcd(paramValue), 0, data, dstPos, 2);
					dstPos += 2;
				} catch (Exception e) {
					AppLog.e(ExceptionUtil.getInfo(e), e);
					e.printStackTrace();
				}
				break;

			case 0x00A0:	// UINT8 智能终端录音模式（OXO1全程录音;0X02:翻牌录音)
				try {
					int paramValue = RecorderBiz.getRecordType();
					data = new byte[3+1];
					// 参数ID	UINT16
					System.arraycopy(Tools.sortToByte(Tools.int2Bytes(paramId,2)), 0, data, dstPos, 2);
					dstPos+=2;
					// 参数长度	UINT8
					System.arraycopy(Tools.sortToByte(Tools.int2Bytes(1,1)), 0, data, dstPos, 1);
					dstPos+=1;
					//参数
					System.arraycopy(Tools.sortToByte(Tools.int2Bytes(paramValue,1)), 0, data, dstPos, 1);
				} catch (Exception e) {
					AppLog.e(ExceptionUtil.getInfo(e), e);
					e.printStackTrace();
				}
				break;
			case 0x00A1:	// UINT8	智能终端录音文件最大时长（1-255)分钟
				try {
					int paramValue = RecorderBiz.getMaxTime();
					data = new byte[3+1];
					// 参数ID	UINT16
					System.arraycopy(Tools.sortToByte(Tools.int2Bytes(paramId,2)), 0, data, dstPos, 2);
					dstPos+=2;
					// 参数长度	UINT8
					System.arraycopy(Tools.sortToByte(Tools.int2Bytes(1,1)), 0, data, dstPos, 1);
					dstPos+=1;
					//参数
					System.arraycopy(Tools.sortToByte(Tools.int2Bytes(paramValue,1)), 0, data, dstPos, 1);
				} catch (Exception e) {
					AppLog.e(ExceptionUtil.getInfo(e), e);
					e.printStackTrace();
				}
				break;
			case 0x00A2: // UINT8 液晶（LCD）心跳时间间隔，1～60，单位为秒（s）
				try {
					int paramValue = SPUtils.getParamInteger(
							SPConstants.PARAMS_LCD_HEARTBEAT_TIME, 60);
					data = new byte[3 + 1];
					// 参数ID UINT16
					System.arraycopy(Tools.sortToByte(Tools.int2Bytes(paramId, 2)),
							0, data, dstPos, 2);
					dstPos += 2;
					// 参数长度 UINT8
					System.arraycopy(Tools.sortToByte(Tools.int2Bytes(1, 1)), 0,
							data, dstPos, 1);
					dstPos += 1;
					// 参数
					System.arraycopy(
							Tools.sortToByte(Tools.int2Bytes(paramValue, 1)), 0,
							data, dstPos, 1);
				} catch (Exception e) {
					AppLog.e(ExceptionUtil.getInfo(e));
					e.printStackTrace();
				}
				break;
			case 0x00A3:	// UINT8	LED心跳时间间隔，单位为秒（s）
				try {
					int paramValue = SPUtils.defaultPref().getInt(SPConstants.PARAMS_LED_HEARTBEAT_TIME, 60);
					data = new byte[3+1];
					// 参数ID	UINT16
					System.arraycopy(Tools.sortToByte(Tools.int2Bytes(paramId,2)), 0, data, dstPos, 2);
					dstPos+=2;
					// 参数长度	UINT8
					System.arraycopy(Tools.sortToByte(Tools.int2Bytes(1,1)), 0, data, dstPos, 1);
					dstPos+=1;
					//参数
					System.arraycopy(Tools.sortToByte(Tools.int2Bytes(paramValue,1)), 0, data, dstPos, 1);
				} catch (Exception e) {
					AppLog.e(ExceptionUtil.getInfo(e), e);
					e.printStackTrace();
				}
				break;
			case 0x00AF:	// UINT16	ACC OFF后进入休眠模式的时间，单位为秒（s）
				try {
					int paramValue = SPUtils.defaultPref().getInt(SPConstants.PARAMS_ACC_OFF_DORMANT_TIME, 120);
					data = new byte[3+2];
					// 参数ID	UINT16
					System.arraycopy(Tools.sortToByte(Tools.int2Bytes(paramId,2)), 0, data, dstPos, 2);
					dstPos+=2;
					// 参数长度	UINT8
					System.arraycopy(Tools.sortToByte(Tools.int2Bytes(2,1)), 0, data, dstPos, 1);
					dstPos+=1;
					//参数
					System.arraycopy(Tools.sortToByte(Tools.int2Bytes(paramValue,2)), 0, data, dstPos, 2);
				} catch (Exception e) {
					AppLog.e(ExceptionUtil.getInfo(e), e);
					e.printStackTrace();
				}
				break;
			case 0x00B0:	// UINT8	视频服务器协议模式 0x00：TCP；0x01：UDP
				try {
					int paramValue = SPUtils.defaultPref().getInt(SPConstants.PARAMS_VEDIO_PROTOCOL_MODE, 0);
					data = new byte[3+1];
					// 参数ID	UINT16
					System.arraycopy(Tools.sortToByte(Tools.int2Bytes(paramId,2)), 0, data, dstPos, 2);
					dstPos+=2;
					// 参数长度	UINT8
					System.arraycopy(Tools.sortToByte(Tools.int2Bytes(1,1)), 0, data, dstPos, 1);
					dstPos+=1;
					//参数
					System.arraycopy(Tools.sortToByte(Tools.int2Bytes(paramValue,1)), 0, data, dstPos, 1);
				} catch (Exception e) {
					AppLog.e(ExceptionUtil.getInfo(e), e);
					e.printStackTrace();
				}
				break;
			case 0x00B1:	// STRING	视频服务器APN，无线通信拨号访问点
				try {
					String paramValue = SPUtils.defaultPref().getString(SPConstants.PARAMS_VEDIO_ADDR, "");
					byte[] paramValueByte = (paramValue).getBytes("GBK");
					data = new byte[3+paramValueByte.length];
					// 参数ID	UINT16
					System.arraycopy(Tools.sortToByte(Tools.int2Bytes(paramId,2)), 0, data, dstPos, 2);
					dstPos+=2;
					// 参数长度	UINT8
					System.arraycopy(Tools.sortToByte(Tools.int2Bytes(paramValueByte.length,1)), 0, data, dstPos, 1);
					dstPos+=1;
					//参数
					System.arraycopy(paramValueByte, 0, data, dstPos, paramValueByte.length);
				} catch (Exception e) {
					AppLog.e(ExceptionUtil.getInfo(e), e);
					e.printStackTrace();
				}
				break;
			case 0x00B2:	// STRING	视频服务器无线通信拨号用户名
				try {
					String paramValue = SPUtils.defaultPref().getString(SPConstants.PARAMS_VEDIO_USER_NAME, "");
					byte[] paramValueByte = (paramValue).getBytes("GBK");
					data = new byte[3+paramValueByte.length];
					// 参数ID	UINT16
					System.arraycopy(Tools.sortToByte(Tools.int2Bytes(paramId,2)), 0, data, dstPos, 2);
					dstPos+=2;
					// 参数长度	UINT8
					System.arraycopy(Tools.sortToByte(Tools.int2Bytes(paramValueByte.length,1)), 0, data, dstPos, 1);
					dstPos+=1;
					//参数
					System.arraycopy(paramValueByte, 0, data, dstPos, paramValueByte.length);
				} catch (Exception e) {
					AppLog.e(ExceptionUtil.getInfo(e), e);
					e.printStackTrace();
				}
				break;
			case 0x00B3:	// STRING	视频服务器无线通信拨号密码
				try {
					String paramValue = SPUtils.defaultPref().getString(SPConstants.PARAMS_VEDIO_USER_PASSWORD, "");
					byte[] paramValueByte = (paramValue).getBytes("GBK");
					data = new byte[3+paramValueByte.length];
					// 参数ID	UINT16
					System.arraycopy(Tools.sortToByte(Tools.int2Bytes(paramId,2)), 0, data, dstPos, 2);
					dstPos+=2;
					// 参数长度	UINT8
					System.arraycopy(Tools.sortToByte(Tools.int2Bytes(paramValueByte.length,1)), 0, data, dstPos, 1);
					dstPos+=1;
					//参数
					System.arraycopy(paramValueByte, 0, data, dstPos, paramValueByte.length);
				} catch (Exception e) {
					AppLog.e(ExceptionUtil.getInfo(e), e);
					e.printStackTrace();
				}
				break;
			case 0x00B4:	// STRING	视频服务器地址,IP或域名
				try {
					String paramValue = SPUtils.defaultPref().getString(SPConstants.PARAMS_VEDIO_IP, "");
					byte[] paramValueByte = (paramValue).getBytes("GBK");
					data = new byte[3+paramValueByte.length];
					// 参数ID	UINT16
					System.arraycopy(Tools.sortToByte(Tools.int2Bytes(paramId,2)), 0, data, dstPos, 2);
					dstPos+=2;
					// 参数长度	UINT8
					System.arraycopy(Tools.sortToByte(Tools.int2Bytes(paramValueByte.length,1)), 0, data, dstPos, 1);
					dstPos+=1;
					//参数
					System.arraycopy(paramValueByte, 0, data, dstPos, paramValueByte.length);
				} catch (Exception e) {
					AppLog.e(ExceptionUtil.getInfo(e), e);
					e.printStackTrace();
				}
				break;
			case 0x00B5:	// UINT32	视频服务器端口
				try {
					int paramValue = SPUtils.defaultPref().getInt(SPConstants.PARAMS_VEDIO_PORT, 0);
					data = new byte[3+4];
					// 参数ID	UINT16
					System.arraycopy(Tools.sortToByte(Tools.int2Bytes(paramId,2)), 0, data, dstPos, 2);
					dstPos+=2;
					// 参数长度	UINT8
					System.arraycopy(Tools.sortToByte(Tools.int2Bytes(4,1)), 0, data, dstPos, 1);
					dstPos+=1;
					//参数
					System.arraycopy(Tools.sortToByte(Tools.int2Bytes(paramValue,4)), 0, data, dstPos, 4);
				} catch (Exception e) {
					AppLog.e(ExceptionUtil.getInfo(e), e);
					e.printStackTrace();
				}
				break;

			default:
				try {
					data = null;
				} catch (Exception e) {
					AppLog.e(ExceptionUtil.getInfo(e));
					e.printStackTrace();
				}
				break;
		}
		return data;
	}

	private static boolean presetTts(int ttsFlag,String message){
		boolean result = false;
		try {
			Log.e(TAG,"presetTts ttsFlag:"+ ttsFlag + " message:" + message);
			//if(ttsFlag == 1){
				String regex = "\\*#TTS\\d{1,2}.*";
				String regexCompile = "\\*#(TTS\\d{1,2})(.*)";//注意此处关键字有括号

				String regexSet = "\\*#SETTTS\\d{1,2}\\w*";
				String regexCompileSet = "\\*#SET(TTS\\d{1,2})";//注意此处关键字有括号
				if(message.matches(regex)){
					Pattern pattern = Pattern.compile(regexCompile);
					Matcher matcher = pattern.matcher(message);
					if (matcher.find()) {
						SPUtils.setParam(matcher.group(1), matcher.group(2));
						result = true;
						//Log.e(TAG,"2 All is  name:"+matcher.group(1)+"  age:"+matcher.group(2));
					}
				}else if(message.matches(regexSet)){
					Pattern pattern = Pattern.compile(regexCompileSet);
					Matcher matcher = pattern.matcher(message);
					if (matcher.find()) {
						SPUtils.setParam(SPConstants.SPK_PRESET_TTS, matcher.group(1));
						result = true;
						//Log.e(TAG,"2 All is:"+matcher.group(0)+"  name:"+matcher.group(1));
					}
				}
			//}
		} catch (Exception e) {
			e.printStackTrace();
		}
		return result;
	}
}
